module_03 - identificadores, keyworks

60
Module 3 Module 3 Identifiers ,Keywords, and Identifiers ,Keywords, and Types Types Objectives Objectives Upon completion of this module, you Upon completion of this module, you should be able to: should be able to: Use comments between in a source Use comments between in a source program program Distinguish between valid and Distinguish between valid and invalid identifiers invalid identifiers

Upload: richard

Post on 24-Jan-2016

15 views

Category:

Documents


0 download

DESCRIPTION

Un modulo que habla sobre temas importantes en java, como utilizar los codigos, y demas , Habla sobre los tipos, identificadores, y las keyworks

TRANSCRIPT

Page 1: Module_03 - Identificadores, keyworks

Module 3Module 3Identifiers ,Keywords, and TypesIdentifiers ,Keywords, and Types

ObjectivesObjectivesUpon completion of this module, you Upon completion of this module, you

should be able to:should be able to:

Use comments between in a source programUse comments between in a source program

Distinguish between valid and invalid identifiersDistinguish between valid and invalid identifiers

Page 2: Module_03 - Identificadores, keyworks

Module 3Module 3Identifiers, Keywords, and Types Identifiers, Keywords, and Types

ObjectivesObjectivesUpon completion of this module, you should be Upon completion of this module, you should be

able to:able to:

Recognize Java technology keywordsRecognize Java technology keywords

List the eight primitive typesList the eight primitive types

Define literal values for numeric and textual Define literal values for numeric and textual typestypes

Page 3: Module_03 - Identificadores, keyworks

Module 3Module 3Identifiers, Keywords, and Types Identifiers, Keywords, and Types

ObjectivesObjectivesUpon completion of this module, you should be Upon completion of this module, you should be

able to:able to:

Define the terms primitive variable and reference Define the terms primitive variable and reference variablevariable

Declare variables of class typeDeclare variables of class type

Construct an object using newConstruct an object using new

Page 4: Module_03 - Identificadores, keyworks

Module 3Module 3Identifiers, Keywords, and Types Identifiers, Keywords, and Types

ObjectivesObjectivesUpon completion of this module, you should be Upon completion of this module, you should be

able to:able to:

Describe default initializationDescribe default initialization

Describe the significance of a reference variableDescribe the significance of a reference variable

State the consequence of assigning variables of State the consequence of assigning variables of class type class type

Page 5: Module_03 - Identificadores, keyworks

Module 3Module 3Identifiers, Keywords, and Types Identifiers, Keywords, and Types

This module describes some of the basic This module describes some of the basic components used in Java technology components used in Java technology programs including variables, keywords, programs including variables, keywords, primitive types, and class types.primitive types, and class types.

Page 6: Module_03 - Identificadores, keyworks

Additional ResourcesAdditional Resources

The following references provide The following references provide additional details on the topics discussed additional details on the topics discussed in this modulein this module

Page 7: Module_03 - Identificadores, keyworks

Additional ResourcesAdditional Resources

Java™ in 60 minutes a dayJava™ in 60 minutes a day By Rich Raposa By Rich Raposa Price:$36.50Price:$36.50 Paperback:Paperback: 800 pages 800 pages Publisher:Publisher: Wiley; 1st edition (May 30, 2003) Wiley; 1st edition (May 30, 2003) Language:Language: English English ISBN-10:ISBN-10: 0471423149 0471423149 ISBN-13:ISBN-13: 978-0471423140 978-0471423140 Product Dimensions: Product Dimensions: 9.2 x 7.4 x 1.7 inches 9.2 x 7.4 x 1.7 inches

http://www.amazon.comhttp://www.amazon.com

Page 8: Module_03 - Identificadores, keyworks

Additional ResourcesAdditional Resources

Page 9: Module_03 - Identificadores, keyworks

Additional ResourcesAdditional Resources

Java™ The UML WayJava™ The UML Way By Else Lervik, Vegard B. HavdalBy Else Lervik, Vegard B. Havdal Price:$65.00Price:$65.00 Paperback:Paperback: 732 pages 732 pages Publisher:Publisher: John Wiley & Sons; English La edition (June John Wiley & Sons; English La edition (June

15, 2002) 15, 2002) Language:Language: English English ISBN-10:ISBN-10: 0470843861 0470843861 ISBN-13:ISBN-13: 978-0470843864 978-0470843864 Product Dimensions: Product Dimensions: 9.2 x 7.6 x 1.7 inches 9.2 x 7.6 x 1.7 inches

http://www.amazon.comhttp://www.amazon.com

Page 10: Module_03 - Identificadores, keyworks

Additional ResourcesAdditional Resources

Page 11: Module_03 - Identificadores, keyworks

Additional ResourcesAdditional Resources

The Java™ Tutorials The Java™ Tutorials

http://java.sun.com/docs/books/tutorial/http://java.sun.com/docs/books/tutorial/

Page 12: Module_03 - Identificadores, keyworks

RelevanceRelevance

Discussion – The following questions are Discussion – The following questions are

relevant to the material presented in thisrelevant to the material presented in this

module:module:Do you known the primitive Java technology types?Do you known the primitive Java technology types?

Can you describe the difference between variables Can you describe the difference between variables holding primitive values as compared with object holding primitive values as compared with object references?references?

Page 13: Module_03 - Identificadores, keyworks

CommentsComments

The three permissible styles of comment in The three permissible styles of comment in a Java technology program are:a Java technology program are:

// comment on one line// comment on one line

/* comment on one or /* comment on one or more linemore line*/*/

/** documentation comment *//** documentation comment */

Page 14: Module_03 - Identificadores, keyworks

CommentsComments

Documentation comments placed Documentation comments placed immediately before a declaration ( of a immediately before a declaration ( of a variable, method, or class) indicate that variable, method, or class) indicate that the comments should be included in the comments should be included in any automatically generated any automatically generated documentation ( for example, the HTML documentation ( for example, the HTML files generated by the javadoc files generated by the javadoc command) to serve as a description of command) to serve as a description of the declared item.the declared item.

Page 15: Module_03 - Identificadores, keyworks

CommentsComments

Note – The format of these comments Note – The format of these comments and the use of the javadoc tool is and the use of the javadoc tool is described in the tooldocs directory of described in the tooldocs directory of the documentation for Java 2 SDK.the documentation for Java 2 SDK.

Page 16: Module_03 - Identificadores, keyworks

Semicolons, Blocks, and White Semicolons, Blocks, and White SpaceSpace

In the Java programming language, a In the Java programming language, a statement is one or more lines of code statement is one or more lines of code terminated with a semicolon (;).terminated with a semicolon (;).

For example,For example,

totals = a + b + c + d + e + f ;totals = a + b + c + d + e + f ;

is a the same asis a the same as

totals = a + b + c +totals = a + b + c +

d + e + f; d + e + f;

Page 17: Module_03 - Identificadores, keyworks

Semicolons, Blocks, and White Semicolons, Blocks, and White SpaceSpace

You must use a block in a class You must use a block in a class definition:definition:

public class MyDate {public class MyDate {

private int day;private int day;

private int month;private int month;

private int year;private int year;

}}

Page 18: Module_03 - Identificadores, keyworks

Semicolons, Blocks, and White Semicolons, Blocks, and White SpaceSpace

A block, sometimes called a A block, sometimes called a compound statement, is a group of compound statement, is a group of statements bound by opening and statements bound by opening and closing braces ( { } ). closing braces ( { } ). A block has useful features that is A block has useful features that is discussed in Module 4, “Expressions discussed in Module 4, “Expressions and Flow Control. “ For now think of a and Flow Control. “ For now think of a block as a group of statements that are block as a group of statements that are collected together.collected together.

Page 19: Module_03 - Identificadores, keyworks

IdentifiersIdentifiers

In the Java programming language, an In the Java programming language, an identifier is a name given to a variable, identifier is a name given to a variable, class, or method. class, or method.

Identifiers start with a letter, Identifiers start with a letter, underscore( _ ), or dollar sign ($). underscore( _ ), or dollar sign ($). Subsequent characters can be digits.Subsequent characters can be digits.

Identifiers are case-sensitive and have Identifiers are case-sensitive and have no maximum length.no maximum length.

Page 20: Module_03 - Identificadores, keyworks

IdentifiersIdentifiers

The following are valid identifiers:The following are valid identifiers:

identifieridentifier

username username

user_nameuser_name

_sys_var1_sys_var1

$change$change

Page 21: Module_03 - Identificadores, keyworks

IdentifiersIdentifiers

Java technology sources are 16-bit Java technology sources are 16-bit Unicode rather than 8-bit ASCII text, so Unicode rather than 8-bit ASCII text, so a latter is a considerably wider a latter is a considerably wider definition than just a to z and A to Z.definition than just a to z and A to Z.

Page 22: Module_03 - Identificadores, keyworks

IdentifiersIdentifiers

While identifiers can use non-ASCIIWhile identifiers can use non-ASCIIcharacters, be aware of the followingcharacters, be aware of the followingcaveats:caveats:

Unicode can support different Unicode can support different characters that look the same.characters that look the same.

Class names should only be in ASCII Class names should only be in ASCII characters because most file systems characters because most file systems do not support Unicode characters.do not support Unicode characters.

Page 23: Module_03 - Identificadores, keyworks

Java KeywordsJava Keywords

The following table list keywords that The following table list keywords that are used in the Java programming are used in the Java programming language.language.

Page 24: Module_03 - Identificadores, keyworks

Java KeywordsJava Keywords

Keywords have special meaning to the Keywords have special meaning to the Java technology compiler.Java technology compiler.

Keywords identify a data type name or Keywords identify a data type name or program construct name.program construct name.

Note – While you might think true and Note – While you might think true and false are keywords, they are false are keywords, they are technically Boolean literals according technically Boolean literals according to the Java Language Specification.to the Java Language Specification.

Page 25: Module_03 - Identificadores, keyworks

Java KeywordsJava Keywords

Keywords have special meaning to the Keywords have special meaning to the Java technology compiler.Java technology compiler.

Keywords identify a data type name or Keywords identify a data type name or program construct name.program construct name.

Note – While you might think true and Note – While you might think true and false are keywords, they are false are keywords, they are technically Boolean literals according technically Boolean literals according to the Java Language Specification.to the Java Language Specification.

Page 26: Module_03 - Identificadores, keyworks

Java KeywordsJava Keywords

Note – While you might think true and Note – While you might think true and false are keywords, they are false are keywords, they are technically Boolean literals according technically Boolean literals according to the Java Language Specification.to the Java Language Specification.

Similarly, null is technically the null Similarly, null is technically the null literal.literal.

Page 27: Module_03 - Identificadores, keyworks

Java KeywordsJava Keywords

The following are important notes The following are important notes about the keywords:about the keywords:

The literals true, false, and null are The literals true, false, and null are lowercase, not uppercase as in the C++ lowercase, not uppercase as in the C++ language. Strictly speaking, these are language. Strictly speaking, these are not keywords but literals; however, the not keywords but literals; however, the distinction is academic.distinction is academic.

Page 28: Module_03 - Identificadores, keyworks

Java KeywordsJava Keywords

There is no sizeof operator; direct There is no sizeof operator; direct memory access is not possible so the memory access is not possible so the information would be valueless.information would be valueless.

The goto and const keywords are not The goto and const keywords are not used in the Java programming used in the Java programming language.language.

Page 29: Module_03 - Identificadores, keyworks

Basic Java Programming Language Basic Java Programming Language TypesTypes

The Java programming language has many built in The Java programming language has many built in data types. These fall into two broad categories, data types. These fall into two broad categories, class types and primitive types.class types and primitive types.

Primitive types are simple values, are not objects.Primitive types are simple values, are not objects.

Class types are used for more complex types, Class types are used for more complex types, including all the types you declare yourself.including all the types you declare yourself.

Class types are used to create objects.Class types are used to create objects.

Page 30: Module_03 - Identificadores, keyworks

Primitives TypesPrimitives Types

The Java programming language defines eight The Java programming language defines eight primitive data types, which can be considered in four primitive data types, which can be considered in four categories:categories:

Logical - booleanLogical - boolean

Textual - charTextual - char

Integral – byte, short, int, and longIntegral – byte, short, int, and long

Floating point – double and floatFloating point – double and float

Page 31: Module_03 - Identificadores, keyworks

Logical - booleanLogical - boolean

The boolean data type has two literals, The boolean data type has two literals, true and false.true and false.

For example, the satement:For example, the satement:

boolean truth = true;boolean truth = true;

declares the variable truth as boolean declares the variable truth as boolean type and assigns it a value of true.type and assigns it a value of true.

Note – There are no casts between Note – There are no casts between integer types and boolean type.integer types and boolean type.

Page 32: Module_03 - Identificadores, keyworks

Textual - char and StringTextual - char and String

Single characters are represented by using Single characters are represented by using the char type. A char represents a 16-bit the char type. A char represents a 16-bit unsigned Unicode character. You must unsigned Unicode character. You must enclose a char literal in single quotes (‘ ‘). enclose a char literal in single quotes (‘ ‘). For example:For example:

‘ ‘a’ – The letter aa’ – The letter a ‘ ‘\t’ - A tab\t’ - A tab ‘ ‘\u????’ – A specific Unicode \u????’ – A specific Unicode character ????, is replaced with exactly four character ????, is replaced with exactly four hexadecimal digits, (for example ‘\u03A6’ is hexadecimal digits, (for example ‘\u03A6’ is the Greek letter phi [ the Greek letter phi [ ΦΦ ] ) ] )

Page 33: Module_03 - Identificadores, keyworks

Textual - char and StringTextual - char and String

You use the String type, which is not a You use the String type, which is not a primitive but a class, to represent primitive but a class, to represent sequences of characters. The character sequences of characters. The character themselves are Unicode.themselves are Unicode.

Unlike C and C++, strings do not end Unlike C and C++, strings do not end with with \0.\0.

Page 34: Module_03 - Identificadores, keyworks

Textual - char and StringTextual - char and String

A String literal is enclosed in double quote A String literal is enclosed in double quote marks:marks:

String greeting = “Good Morning !! “String greeting = “Good Morning !! “

Some examples of the declaration and Some examples of the declaration and initialization of char and String type variable initialization of char and String type variable are:are:

char c = ‘A’;char c = ‘A’;char c1,c2;char c1,c2;String str1, str2;String str1, str2;

Page 35: Module_03 - Identificadores, keyworks

Integral – byte, short, int and longIntegral – byte, short, int and long

There are four integral types in the Java There are four integral types in the Java programming language.programming language.

Each type is declared using one of the Each type is declared using one of the keywords byte, short, int, or long.keywords byte, short, int, or long.

You can represent literals of integral You can represent literals of integral type using decimal, octal, or type using decimal, octal, or hexadecimal.hexadecimal.

All numeric types in the Java All numeric types in the Java programming language represent programming language represent signed numbers.signed numbers.

Page 36: Module_03 - Identificadores, keyworks

Integral – byte, short, int and longIntegral – byte, short, int and long

There are four integral types in the Java There are four integral types in the Java programming language.programming language.

Each type is declared using one of the Each type is declared using one of the keywords byte, short, int, or long.keywords byte, short, int, or long.

You can represent literals of integral You can represent literals of integral type using decimal, octal, or type using decimal, octal, or hexadecimal.hexadecimal.

All numeric types in the Java All numeric types in the Java programming language represent programming language represent signed numbers.signed numbers.

Page 37: Module_03 - Identificadores, keyworks

Integral – byte, short, int and longIntegral – byte, short, int and long

Integral literals are of type int Integral literals are of type int unless explicitly followed by the unless explicitly followed by the letter “L”, which indicates a long letter “L”, which indicates a long value.value.In Java programming language In Java programming language you can use either an uppercase you can use either an uppercase or lowercase L.or lowercase L.A lowercase L is not A lowercase L is not recommended because it is hard recommended because it is hard to distinguish from the digit 1.to distinguish from the digit 1.

Page 38: Module_03 - Identificadores, keyworks

Floating Point – float and doubleFloating Point – float and double

You can declare a floating point variable You can declare a floating point variable using the keywords float or double.using the keywords float or double.Floating point literals are double by default.Floating point literals are double by default.You can declare a literal of type float by You can declare a literal of type float by appending F or f to the value.appending F or f to the value.The format of a floating point number is The format of a floating point number is defined by the Java Language Specification to defined by the Java Language Specification to Institute of Electrical and Electronics Institute of Electrical and Electronics Engineers (IEEE)754.Engineers (IEEE)754.Floating point literals are double unless Floating point literals are double unless explicitly declared as float.explicitly declared as float.The format of the primitives types is platform The format of the primitives types is platform independent.independent.

Page 39: Module_03 - Identificadores, keyworks

Primitive Data Type Size and Primitive Data Type Size and RangeRange

Page 40: Module_03 - Identificadores, keyworks

Java Reference TypesJava Reference Types

There are eight primitive Java There are eight primitive Java types: boolean, char, byte, short, types: boolean, char, byte, short, int, long, float, and double.int, long, float, and double.

A reference variable contains a A reference variable contains a “handle” to an object.“handle” to an object.

Page 41: Module_03 - Identificadores, keyworks

Java Reference TypesJava Reference Types

Example:Example: public class MyDate {public class MyDate { private int day = 1;private int day = 1; private int month = 1;private int month = 1; private int year = 2007;private int year = 2007; public MyDate (int day, int month, public MyDate (int day, int month,

int year)int year) { … }{ … } public void print() { …}public void print() { …} }}

Page 42: Module_03 - Identificadores, keyworks

Java Reference TypesJava Reference Types

The following is an example of using The following is an example of using MyDate:MyDate:

public class TestMyDate {public class TestMyDate {public static void main(String[] args) {public static void main(String[] args) { MyDate today = MyDate (22, 7, 1964);MyDate today = MyDate (22, 7, 1964); }} }}The variable today is a reference variableThe variable today is a reference variableholding one MyDate object.holding one MyDate object.

Page 43: Module_03 - Identificadores, keyworks

Constructing and Initializing Constructing and Initializing ObjectsObjects

You must execute a call to new Xxx() to allocate You must execute a call to new Xxx() to allocate space for a new object.space for a new object.

For example, using the keyword For example, using the keyword new MyDate(22, 7, 1964) causes the following:new MyDate(22, 7, 1964) causes the following:

First, the space for the new object is allocated First, the space for the new object is allocated and initialized to the form of 0 or null. In the Java and initialized to the form of 0 or null. In the Java programming language, this phase is indivisible programming language, this phase is indivisible to ensure that you cannot have an object with to ensure that you cannot have an object with random values in it.random values in it.

Page 44: Module_03 - Identificadores, keyworks

Constructing and Initializing Constructing and Initializing ObjectsObjects

Second, any explicit initialization is Second, any explicit initialization is performed.performed.Third, a constructor, which is a special Third, a constructor, which is a special method, is executed. Arguments passed in method, is executed. Arguments passed in the parentheses to new are passed to the the parentheses to new are passed to the constructor(22,7,1964).constructor(22,7,1964).Finally, the variable is assigned the Finally, the variable is assigned the reference to the new object in heap reference to the new object in heap memory.memory.

Page 45: Module_03 - Identificadores, keyworks

The this ReferenceThe this Reference

Two uses of the this keyword are:Two uses of the this keyword are:

Reference a member when a local Reference a member when a local variable has the same name.variable has the same name.Pass the current object as a parameter toPass the current object as a parameter to

another method. For example,another method. For example,

MyDate new_date = new MyDate(this);MyDate new_date = new MyDate(this);

Page 46: Module_03 - Identificadores, keyworks

Java Programming Language Java Programming Language Coding ConventionsCoding Conventions

The following are the coding conventions ofThe following are the coding conventions ofthe Java programming language:the Java programming language:

Packages – Package names should be Packages – Package names should be nouns in lowercase.nouns in lowercase.

package shipping.objectspackage shipping.objects Classes – Class names should be nouns, Classes – Class names should be nouns, in mixed case, with the first letter of each in mixed case, with the first letter of each word capitalized.word capitalized.

class AccountBookclass AccountBook

Page 47: Module_03 - Identificadores, keyworks

Java Programming Language Java Programming Language Coding ConventionsCoding Conventions

The following are the coding conventions ofThe following are the coding conventions ofthe Java programming language:the Java programming language:

Interfaces – Interface names should be Interfaces – Interface names should be capitalized like class names.capitalized like class names.

interface Account.interface Account. Methods – Method names should be verbs, in Methods – Method names should be verbs, in mixed case, with the first letter in lowercase. mixed case, with the first letter in lowercase. Within each method name, capital letters Within each method name, capital letters separate words. Limit the use of underscores.separate words. Limit the use of underscores.

balanceAccount()balanceAccount()

Page 48: Module_03 - Identificadores, keyworks

Java Programming Language Java Programming Language Coding ConventionsCoding Conventions

Variables – All variables should be in mixed Variables – All variables should be in mixed case with a lowercase first letter. Words are case with a lowercase first letter. Words are separated by capital letters. Limit the use of separated by capital letters. Limit the use of underscores, and avoid using the dollar ($) underscores, and avoid using the dollar ($) because this character has special meaning to because this character has special meaning to inner classes.inner classes.

Example, currentCustomerExample, currentCustomer Variables should be meaningful and indicate to Variables should be meaningful and indicate to

the casual reader the intent of their use. Avoid the casual reader the intent of their use. Avoid single character names except for temporary single character names except for temporary “throwaway” variables ( for example, I, j and k, “throwaway” variables ( for example, I, j and k, used as loop control variables).used as loop control variables).

Page 49: Module_03 - Identificadores, keyworks

Java Programming Language Java Programming Language Coding ConventionsCoding Conventions

The following are the coding conventions ofThe following are the coding conventions of

the Java programming language:the Java programming language:

Constant – Primitive constants should be Constant – Primitive constants should be all uppercase with the words separated by all uppercase with the words separated by underscores. Object constants can use underscores. Object constants can use mixed case letters.mixed case letters.

HEAD_COUNTHEAD_COUNT

MAXIMUM_SIZEMAXIMUM_SIZE

Page 50: Module_03 - Identificadores, keyworks

Java Programming Language Java Programming Language Coding ConventionsCoding Conventions

The following are the coding conventions ofThe following are the coding conventions of

the Java programming language:the Java programming language:

Control structures – Use braces ( { } ) Control structures – Use braces ( { } ) around all statements, even single around all statements, even single statements, when they are part of a control statements, when they are part of a control structure, such as an if-else or for structure, such as an if-else or for statement.statement.

Page 51: Module_03 - Identificadores, keyworks

Java Programming Language Java Programming Language Coding ConventionsCoding Conventions

The following are the coding conventions ofThe following are the coding conventions of

the Java programming language:the Java programming language:

Spacing – Place only a single statement Spacing – Place only a single statement on any line, and use two or four-space on any line, and use two or four-space indentations to make your code readable. indentations to make your code readable. The number of spaces can vary depending The number of spaces can vary depending on what code standards you use.on what code standards you use.

Page 52: Module_03 - Identificadores, keyworks

Java Programming Language Java Programming Language Coding ConventionsCoding Conventions

The following are the coding conventions ofThe following are the coding conventions of

the Java programming language:the Java programming language:

Comments – Use comments to explain Comments – Use comments to explain code segments that are not obvious. code segments that are not obvious. Use // comment delimeter for normal Use // comment delimeter for normal commenting; you can use comment large commenting; you can use comment large sections of code using the /* … */ sections of code using the /* … */ delimeters.delimeters.

Page 53: Module_03 - Identificadores, keyworks

Java Programming Language Java Programming Language Coding ConventionsCoding Conventions

The following are the coding conventions ofThe following are the coding conventions of

the Java programming language:the Java programming language:

Use the /** . . . */ documenting comment Use the /** . . . */ documenting comment to provide input to javadoc for generating to provide input to javadoc for generating HTML documentation for the code.HTML documentation for the code.

Page 54: Module_03 - Identificadores, keyworks

Exercise SummaryExercise Summary

Discussion – Take a few minutes to discuss Discussion – Take a few minutes to discuss what experiences, issues, or discoveries what experiences, issues, or discoveries you had during the lab exercises.you had during the lab exercises.

ExperiencesExperiences

InterpretationsInterpretations

ConclusionsConclusions

ApplicationsApplications

Page 55: Module_03 - Identificadores, keyworks

Check Your ProgressCheck Your Progress

Before continuing on to the next module, Before continuing on to the next module, check to be sure that you can:check to be sure that you can:

Define modeling concepts: abstraction, Define modeling concepts: abstraction, and packagesand packages

Define class, member, attribute, method, Define class, member, attribute, method, constructor, and packageconstructor, and package

Page 56: Module_03 - Identificadores, keyworks

Check Your ProgressCheck Your Progress

Use the access modifiers private and Use the access modifiers private and public as appropriate for the guidelines of public as appropriate for the guidelines of encapsulationencapsulation

Invoke a method on a particular objectInvoke a method on a particular object

Page 57: Module_03 - Identificadores, keyworks

Check Your ProgressCheck Your Progress

Before continuing on to the next module,Before continuing on to the next module,

check to be sure that you can:check to be sure that you can:

Use comments in a source programUse comments in a source program

Distinguish between valid and invalid Distinguish between valid and invalid identifiersidentifiers

Recognize Java technology keywordsRecognize Java technology keywords

List the eight primitive typesList the eight primitive types

Page 58: Module_03 - Identificadores, keyworks

Check Your ProgressCheck Your Progress

Before continuing on to the next module,Before continuing on to the next module,

check to be sure that you can:check to be sure that you can:

Define literal values for numeric and Define literal values for numeric and textual typestextual types

Define the terms primitive variable and Define the terms primitive variable and reference variablereference variable

Declare variables of type classDeclare variables of type class

Page 59: Module_03 - Identificadores, keyworks

Check Your ProgressCheck Your Progress

Before continuing on to the next module,Before continuing on to the next module,

check to be sure that you can:check to be sure that you can:

Construct an object using newConstruct an object using new

Describe default initializationDescribe default initialization

Describe the significance of a reference Describe the significance of a reference variablevariable

State the consequences of assigning State the consequences of assigning variables of class typevariables of class type

Page 60: Module_03 - Identificadores, keyworks

Think BeyoundThink Beyound

Can you think of examples of classes and Can you think of examples of classes and objects in your existing applications?objects in your existing applications?