SlideShare una empresa de Scribd logo
1 de 3
Descargar para leer sin conexión
Kenia Álava
There are a bunch of guys that are used very often in programming and requires special
treatment. Types can be considered as "primitive", the reason for this special treatment is
that to create a new object, a simple variable small, not efficient. To these primitive types,
Java uses the technique used in C and C + +, that is, instead of creating the new variable
creates a variable "automatic" is not a reference.

Java determines the size of each primitive type. These sizes do not change from one
machine to another architecture. This invariability of the sizes is one of the reasons of
portability java.




                                                                          Kenia Álava
Defaults primitive members

When a primitive data type as a member of a class, Java guarantees that you will be
assigned a default value if it fails to boot:




The defaults are only the values that Java guarantees when the variable is used as a class
member. This ensures that the member variables of primitive type always be initialized
(something C + + does not do), reducing a source of potential errors. However, this initial
value may not be correct or even legal for the program you are writing. It is best to always
initialize variables explicitly.

This warranty does not apply to initialize local variables, those that are not class fields.




                                                                            Kenia Álava

Más contenido relacionado

Similar a Class 5

Object-Oriented Programming with Java UNIT 1
Object-Oriented Programming with Java UNIT 1Object-Oriented Programming with Java UNIT 1
Object-Oriented Programming with Java UNIT 1SURBHI SAROHA
 
Java Simplified: Understanding Programming Basics
Java Simplified: Understanding Programming BasicsJava Simplified: Understanding Programming Basics
Java Simplified: Understanding Programming BasicsAkshaj Vadakkath Joshy
 
Advantages of java programming language
Advantages of java programming languageAdvantages of java programming language
Advantages of java programming languageamiluafiah
 
Java Basics Presentation
Java Basics PresentationJava Basics Presentation
Java Basics PresentationOmid Sohrabi
 
Java questions and answers jan bask.net
Java questions and answers jan bask.netJava questions and answers jan bask.net
Java questions and answers jan bask.netJanbask ItTraining
 
Angular Unit testing.pptx
Angular Unit testing.pptxAngular Unit testing.pptx
Angular Unit testing.pptxRiyaBangera
 
Functional programming with Java 8
Functional programming with Java 8Functional programming with Java 8
Functional programming with Java 8Talha Ocakçı
 
Java programming language
Java programming languageJava programming language
Java programming languageSubhashKumar329
 
Java2 platform
Java2 platformJava2 platform
Java2 platformSajan Sahu
 
Core java learning path for beginners
Core java learning path for beginnersCore java learning path for beginners
Core java learning path for beginnersJobbackingCodeHelpMe
 
Top 10 Important Core Java Interview questions and answers.pdf
Top 10 Important Core Java Interview questions and answers.pdfTop 10 Important Core Java Interview questions and answers.pdf
Top 10 Important Core Java Interview questions and answers.pdfUmesh Kumar
 
Core Java interview questions-ppt
Core Java interview questions-pptCore Java interview questions-ppt
Core Java interview questions-pptMayank Kumar
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to javasanjay joshi
 
Java Fundamentals in Mule
Java Fundamentals in MuleJava Fundamentals in Mule
Java Fundamentals in MuleAnand kalla
 
Enumerations in java.pptx
Enumerations in java.pptxEnumerations in java.pptx
Enumerations in java.pptxSrizan Pokrel
 
Introduction to java
Introduction to java Introduction to java
Introduction to java sanjay joshi
 

Similar a Class 5 (20)

Object-Oriented Programming with Java UNIT 1
Object-Oriented Programming with Java UNIT 1Object-Oriented Programming with Java UNIT 1
Object-Oriented Programming with Java UNIT 1
 
Java basic
Java basicJava basic
Java basic
 
Java Simplified: Understanding Programming Basics
Java Simplified: Understanding Programming BasicsJava Simplified: Understanding Programming Basics
Java Simplified: Understanding Programming Basics
 
Advantages of java programming language
Advantages of java programming languageAdvantages of java programming language
Advantages of java programming language
 
OOPS.pptx
OOPS.pptxOOPS.pptx
OOPS.pptx
 
Java Basics Presentation
Java Basics PresentationJava Basics Presentation
Java Basics Presentation
 
Java questions and answers jan bask.net
Java questions and answers jan bask.netJava questions and answers jan bask.net
Java questions and answers jan bask.net
 
Angular Unit testing.pptx
Angular Unit testing.pptxAngular Unit testing.pptx
Angular Unit testing.pptx
 
From Java to Kotlin
From Java to KotlinFrom Java to Kotlin
From Java to Kotlin
 
Functional programming with Java 8
Functional programming with Java 8Functional programming with Java 8
Functional programming with Java 8
 
Java programming language
Java programming languageJava programming language
Java programming language
 
Java2 platform
Java2 platformJava2 platform
Java2 platform
 
Core java learning path for beginners
Core java learning path for beginnersCore java learning path for beginners
Core java learning path for beginners
 
Top 10 Important Core Java Interview questions and answers.pdf
Top 10 Important Core Java Interview questions and answers.pdfTop 10 Important Core Java Interview questions and answers.pdf
Top 10 Important Core Java Interview questions and answers.pdf
 
Core Java interview questions-ppt
Core Java interview questions-pptCore Java interview questions-ppt
Core Java interview questions-ppt
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Java Fundamentals in Mule
Java Fundamentals in MuleJava Fundamentals in Mule
Java Fundamentals in Mule
 
Enumerations in java.pptx
Enumerations in java.pptxEnumerations in java.pptx
Enumerations in java.pptx
 
OOPS JAVA.pdf
OOPS JAVA.pdfOOPS JAVA.pdf
OOPS JAVA.pdf
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 

Más de Miguel Mastarreno Macías (20)

Miguel portafolioingles
Miguel portafolioinglesMiguel portafolioingles
Miguel portafolioingles
 
Kenia
KeniaKenia
Kenia
 
Folder aby
Folder abyFolder aby
Folder aby
 
Mata
MataMata
Mata
 
Gisella bravo portafolio
Gisella bravo portafolioGisella bravo portafolio
Gisella bravo portafolio
 
Portafolio kenia original 2 a
Portafolio kenia original 2 aPortafolio kenia original 2 a
Portafolio kenia original 2 a
 
Class 3 2ciclo
Class 3 2cicloClass 3 2ciclo
Class 3 2ciclo
 
Class 1 y 2 2ciclo
Class 1 y 2 2cicloClass 1 y 2 2ciclo
Class 1 y 2 2ciclo
 
Proyecto
ProyectoProyecto
Proyecto
 
Proyecto de ingles traducido
Proyecto de ingles traducidoProyecto de ingles traducido
Proyecto de ingles traducido
 
Class 6
Class 6Class 6
Class 6
 
Class 4
Class 4Class 4
Class 4
 
Class 3
Class 3Class 3
Class 3
 
Class 2
Class 2Class 2
Class 2
 
Class 1
Class 1Class 1
Class 1
 
Kenii
KeniiKenii
Kenii
 
Gissy
GissyGissy
Gissy
 
Aby
AbyAby
Aby
 
Folder
FolderFolder
Folder
 
Gestor proyectocalculo
Gestor proyectocalculoGestor proyectocalculo
Gestor proyectocalculo
 

Class 5

  • 2. There are a bunch of guys that are used very often in programming and requires special treatment. Types can be considered as "primitive", the reason for this special treatment is that to create a new object, a simple variable small, not efficient. To these primitive types, Java uses the technique used in C and C + +, that is, instead of creating the new variable creates a variable "automatic" is not a reference. Java determines the size of each primitive type. These sizes do not change from one machine to another architecture. This invariability of the sizes is one of the reasons of portability java. Kenia Álava
  • 3. Defaults primitive members When a primitive data type as a member of a class, Java guarantees that you will be assigned a default value if it fails to boot: The defaults are only the values that Java guarantees when the variable is used as a class member. This ensures that the member variables of primitive type always be initialized (something C + + does not do), reducing a source of potential errors. However, this initial value may not be correct or even legal for the program you are writing. It is best to always initialize variables explicitly. This warranty does not apply to initialize local variables, those that are not class fields. Kenia Álava