SlideShare a Scribd company logo
1 of 15
Download to read offline
Java object has a State and Behavior
State (Variables)
Variable or Field is nothing but the property of the class
class “computer” may have property like :
– Model
– mem_size
– hd_size
– os_type etc
Class Name
first letter should be
in Upper Case
If several words are used to form a name of the class each inner
words first letter should be in Upper Case.
Ex: MyFirstJavaExample
Behavior (Methods)
Method is nothing but the operation that an object can perform
It tells How an object can interact with outside world
Method Name
All method names should
start with a Lower Case letter.
Ex:
public void myMethodName( )
Java Application
is a Java class having main method
main method
should be public
– Class loader need to access this method
should be static
– method would be executed without an object
HelloWorld.java
● Compile the code
– javac HelloWorld.java
● Run the code
– java HelloWorld
Java is Case Sensitive
● Both the compiler (javac) and launcher (java) are case-
sensitive.
● Type all code, commands, and file names exactly as shown.
– HelloWorld is not the same as helloworld
Program File Name
Name of the program file should exactly match the class
name.
When saving the file you should save it using the class name
and append ‘.java’ to the end of the name.
Example :
class ‘HelloWorld’ should be saved in file ‘HelloWorld.java’
Java Identifiers
All java components require names.
Names used for classes, variables and methods
are called identifiers.
Java Keywords
These are reserved words and may not be used as
constant or variable or any other identifier names.
Examples:
abstract, boolean, break, byte, class, package etc.
Comments in Java
Java supports single line and multi-line comments very similar
to c and c++.
All characters available inside any comment are ignored by
Java compiler.
Using Blank Lines
A line containing only whitespace is known as a blank line,
and Java ignores it.

More Related Content

What's hot

Access specifiers (Public Private Protected) C++
Access specifiers (Public Private  Protected) C++Access specifiers (Public Private  Protected) C++
Access specifiers (Public Private Protected) C++vivekkumar2938
 
Inner Classes
Inner ClassesInner Classes
Inner Classesparag
 
Java classes and objects interview questions
Java classes and objects interview questionsJava classes and objects interview questions
Java classes and objects interview questionsDhivyashree Selvarajtnkpm
 
More oop in java
More oop in javaMore oop in java
More oop in javaSAGARDAVE29
 
Java Inheritance - sub class constructors - Method overriding
Java Inheritance - sub class constructors - Method overridingJava Inheritance - sub class constructors - Method overriding
Java Inheritance - sub class constructors - Method overridingNithyaN19
 
Access modifiers
Access modifiersAccess modifiers
Access modifiersJadavsejal
 
Introducing classes
Introducing classesIntroducing classes
Introducing classesRiaz Ahmed
 
Access specifier
Access specifierAccess specifier
Access specifierzindadili
 
Final Class in Java - By JavaGoal
Final Class in Java - By JavaGoalFinal Class in Java - By JavaGoal
Final Class in Java - By JavaGoalJavaGoal
 
Inheritance and Polymorphism
Inheritance and PolymorphismInheritance and Polymorphism
Inheritance and PolymorphismKartikKapgate
 
Class notes(week 7) on packages
Class notes(week 7) on packagesClass notes(week 7) on packages
Class notes(week 7) on packagesKuntal Bhowmick
 
Learn Java language fundamentals with Unit nexus
Learn Java language fundamentals with Unit nexusLearn Java language fundamentals with Unit nexus
Learn Java language fundamentals with Unit nexusUnit Nexus Pvt. Ltd.
 
Java tutorial for beginners-tibacademy.in
Java tutorial for beginners-tibacademy.inJava tutorial for beginners-tibacademy.in
Java tutorial for beginners-tibacademy.inTIB Academy
 
object oriented programming using c++
 object oriented programming using c++ object oriented programming using c++
object oriented programming using c++fasalsial1fasalsial1
 
116824015 java-j2 ee
116824015 java-j2 ee116824015 java-j2 ee
116824015 java-j2 eehomeworkping9
 

What's hot (20)

JAVA PROGRAMMING – Packages - Stream based I/O
JAVA PROGRAMMING – Packages - Stream based I/O JAVA PROGRAMMING – Packages - Stream based I/O
JAVA PROGRAMMING – Packages - Stream based I/O
 
Access specifiers (Public Private Protected) C++
Access specifiers (Public Private  Protected) C++Access specifiers (Public Private  Protected) C++
Access specifiers (Public Private Protected) C++
 
Inner Classes
Inner ClassesInner Classes
Inner Classes
 
Java classes and objects interview questions
Java classes and objects interview questionsJava classes and objects interview questions
Java classes and objects interview questions
 
More oop in java
More oop in javaMore oop in java
More oop in java
 
Java Inheritance - sub class constructors - Method overriding
Java Inheritance - sub class constructors - Method overridingJava Inheritance - sub class constructors - Method overriding
Java Inheritance - sub class constructors - Method overriding
 
Access modifiers
Access modifiersAccess modifiers
Access modifiers
 
Introducing classes
Introducing classesIntroducing classes
Introducing classes
 
Access specifier
Access specifierAccess specifier
Access specifier
 
Final Class in Java - By JavaGoal
Final Class in Java - By JavaGoalFinal Class in Java - By JavaGoal
Final Class in Java - By JavaGoal
 
Inheritance and Polymorphism
Inheritance and PolymorphismInheritance and Polymorphism
Inheritance and Polymorphism
 
C# Access modifiers
C# Access modifiersC# Access modifiers
C# Access modifiers
 
Class notes(week 7) on packages
Class notes(week 7) on packagesClass notes(week 7) on packages
Class notes(week 7) on packages
 
Learn Java language fundamentals with Unit nexus
Learn Java language fundamentals with Unit nexusLearn Java language fundamentals with Unit nexus
Learn Java language fundamentals with Unit nexus
 
Java packages
Java packagesJava packages
Java packages
 
Java tutorial for beginners-tibacademy.in
Java tutorial for beginners-tibacademy.inJava tutorial for beginners-tibacademy.in
Java tutorial for beginners-tibacademy.in
 
object oriented programming using c++
 object oriented programming using c++ object oriented programming using c++
object oriented programming using c++
 
116824015 java-j2 ee
116824015 java-j2 ee116824015 java-j2 ee
116824015 java-j2 ee
 
java tutorial 4
 java tutorial 4 java tutorial 4
java tutorial 4
 
Java
JavaJava
Java
 

Viewers also liked

Java basic data types
Java basic data typesJava basic data types
Java basic data typesjavaicon
 
JAVA Data Types - Part 1
JAVA Data Types - Part 1JAVA Data Types - Part 1
JAVA Data Types - Part 1Ashok Asn
 
1 java - data type
1  java - data type1  java - data type
1 java - data typevinay arora
 
3 java - variable type
3  java - variable type3  java - variable type
3 java - variable typevinay arora
 
Wynberg girls high-Jade Gibson-maths-grade9-statistics analysing data
Wynberg girls high-Jade Gibson-maths-grade9-statistics analysing dataWynberg girls high-Jade Gibson-maths-grade9-statistics analysing data
Wynberg girls high-Jade Gibson-maths-grade9-statistics analysing dataWynberg Girls High
 
Variables statistics
Variables statisticsVariables statistics
Variables statisticsKhushbu :-)
 
MD Paediatrics (Part 1) - Overview of Basic Statistics
MD Paediatrics (Part 1) - Overview of Basic StatisticsMD Paediatrics (Part 1) - Overview of Basic Statistics
MD Paediatrics (Part 1) - Overview of Basic StatisticsBernard Deepal W. Jayamanne
 
Descriptive statistics
Descriptive statisticsDescriptive statistics
Descriptive statisticsHiba Armouche
 
Social media : Type & Statistics
Social media : Type & StatisticsSocial media : Type & Statistics
Social media : Type & StatisticsRahul Yadav
 
Type of data @ Web Mining Discussion
Type of data @ Web Mining DiscussionType of data @ Web Mining Discussion
Type of data @ Web Mining DiscussionCherryBerry2
 
Biostatistics : Types of Variable
Biostatistics : Types of VariableBiostatistics : Types of Variable
Biostatistics : Types of VariableTarekk Alazabee
 
Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C ProgrammingKamal Acharya
 
Basics stat ppt-types of data
Basics stat ppt-types of dataBasics stat ppt-types of data
Basics stat ppt-types of dataFarhana Shaheen
 
Introduction to Statistics (Part -I)
Introduction to Statistics (Part -I)Introduction to Statistics (Part -I)
Introduction to Statistics (Part -I)YesAnalytics
 

Viewers also liked (20)

Java basic data types
Java basic data typesJava basic data types
Java basic data types
 
JAVA Data Types - Part 1
JAVA Data Types - Part 1JAVA Data Types - Part 1
JAVA Data Types - Part 1
 
1 java - data type
1  java - data type1  java - data type
1 java - data type
 
Java basic introduction
Java basic introductionJava basic introduction
Java basic introduction
 
3 java - variable type
3  java - variable type3  java - variable type
3 java - variable type
 
Wynberg girls high-Jade Gibson-maths-grade9-statistics analysing data
Wynberg girls high-Jade Gibson-maths-grade9-statistics analysing dataWynberg girls high-Jade Gibson-maths-grade9-statistics analysing data
Wynberg girls high-Jade Gibson-maths-grade9-statistics analysing data
 
Variables statistics
Variables statisticsVariables statistics
Variables statistics
 
MD Paediatrics (Part 1) - Overview of Basic Statistics
MD Paediatrics (Part 1) - Overview of Basic StatisticsMD Paediatrics (Part 1) - Overview of Basic Statistics
MD Paediatrics (Part 1) - Overview of Basic Statistics
 
Control statement-Selective
Control statement-SelectiveControl statement-Selective
Control statement-Selective
 
Descriptive statistics
Descriptive statisticsDescriptive statistics
Descriptive statistics
 
Social media : Type & Statistics
Social media : Type & StatisticsSocial media : Type & Statistics
Social media : Type & Statistics
 
Type of data @ Web Mining Discussion
Type of data @ Web Mining DiscussionType of data @ Web Mining Discussion
Type of data @ Web Mining Discussion
 
Biostatistics : Types of Variable
Biostatistics : Types of VariableBiostatistics : Types of Variable
Biostatistics : Types of Variable
 
Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C Programming
 
Basics stat ppt-types of data
Basics stat ppt-types of dataBasics stat ppt-types of data
Basics stat ppt-types of data
 
Data type
Data typeData type
Data type
 
Control statements
Control statementsControl statements
Control statements
 
Data types
Data typesData types
Data types
 
Roultes law
Roultes lawRoultes law
Roultes law
 
Introduction to Statistics (Part -I)
Introduction to Statistics (Part -I)Introduction to Statistics (Part -I)
Introduction to Statistics (Part -I)
 

Similar to Java Object State and Behavior in Under 40

Basic Java Programming
Basic Java ProgrammingBasic Java Programming
Basic Java ProgrammingMath-Circle
 
OCA Java SE 8 Exam Chapter 1 Java Building Blocks
OCA Java SE 8 Exam Chapter 1 Java Building BlocksOCA Java SE 8 Exam Chapter 1 Java Building Blocks
OCA Java SE 8 Exam Chapter 1 Java Building Blocksİbrahim Kürce
 
Java syntax-and-grammars-oct8
Java syntax-and-grammars-oct8Java syntax-and-grammars-oct8
Java syntax-and-grammars-oct8MISSIASABTAL1
 
Basics of java 2
Basics of java 2Basics of java 2
Basics of java 2Raghu nath
 
Classes and Objects
Classes and ObjectsClasses and Objects
Classes and Objectsvmadan89
 
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...Ayes Chinmay
 
Java for Mainframers
Java for MainframersJava for Mainframers
Java for MainframersRich Helton
 
Object Oriented Principles
Object Oriented PrinciplesObject Oriented Principles
Object Oriented PrinciplesSujit Majety
 
Android Training (Java Review)
Android Training (Java Review)Android Training (Java Review)
Android Training (Java Review)Khaled Anaqwa
 
Unit of competency
Unit of competencyUnit of competency
Unit of competencyloidasacueza
 

Similar to Java Object State and Behavior in Under 40 (20)

Basic syntax
Basic syntaxBasic syntax
Basic syntax
 
Java basics
Java basicsJava basics
Java basics
 
Basic Java Programming
Basic Java ProgrammingBasic Java Programming
Basic Java Programming
 
java
java java
java
 
Java notes
Java notesJava notes
Java notes
 
OCA Java SE 8 Exam Chapter 1 Java Building Blocks
OCA Java SE 8 Exam Chapter 1 Java Building BlocksOCA Java SE 8 Exam Chapter 1 Java Building Blocks
OCA Java SE 8 Exam Chapter 1 Java Building Blocks
 
Computer programming 2 chapter 1
Computer programming 2  chapter 1Computer programming 2  chapter 1
Computer programming 2 chapter 1
 
Java syntax-and-grammars-oct8
Java syntax-and-grammars-oct8Java syntax-and-grammars-oct8
Java syntax-and-grammars-oct8
 
Basics of java 2
Basics of java 2Basics of java 2
Basics of java 2
 
Classes and Objects
Classes and ObjectsClasses and Objects
Classes and Objects
 
Java PPt.ppt
Java PPt.pptJava PPt.ppt
Java PPt.ppt
 
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
 
Java for Mainframers
Java for MainframersJava for Mainframers
Java for Mainframers
 
Object Oriented Principles
Object Oriented PrinciplesObject Oriented Principles
Object Oriented Principles
 
INTRODUCTION TO JAVA
INTRODUCTION TO JAVAINTRODUCTION TO JAVA
INTRODUCTION TO JAVA
 
Viva file
Viva fileViva file
Viva file
 
Android Training (Java Review)
Android Training (Java Review)Android Training (Java Review)
Android Training (Java Review)
 
Java_Roadmap.pptx
Java_Roadmap.pptxJava_Roadmap.pptx
Java_Roadmap.pptx
 
Unit of competency
Unit of competencyUnit of competency
Unit of competency
 
java01.ppt
java01.pptjava01.ppt
java01.ppt
 

Recently uploaded

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 

Recently uploaded (20)

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 

Java Object State and Behavior in Under 40

  • 1. Java object has a State and Behavior
  • 2. State (Variables) Variable or Field is nothing but the property of the class class “computer” may have property like : – Model – mem_size – hd_size – os_type etc
  • 3. Class Name first letter should be in Upper Case If several words are used to form a name of the class each inner words first letter should be in Upper Case. Ex: MyFirstJavaExample
  • 4. Behavior (Methods) Method is nothing but the operation that an object can perform It tells How an object can interact with outside world
  • 5. Method Name All method names should start with a Lower Case letter. Ex: public void myMethodName( )
  • 6. Java Application is a Java class having main method
  • 7. main method should be public – Class loader need to access this method should be static – method would be executed without an object
  • 9. ● Compile the code – javac HelloWorld.java ● Run the code – java HelloWorld
  • 10. Java is Case Sensitive ● Both the compiler (javac) and launcher (java) are case- sensitive. ● Type all code, commands, and file names exactly as shown. – HelloWorld is not the same as helloworld
  • 11. Program File Name Name of the program file should exactly match the class name. When saving the file you should save it using the class name and append ‘.java’ to the end of the name. Example : class ‘HelloWorld’ should be saved in file ‘HelloWorld.java’
  • 12. Java Identifiers All java components require names. Names used for classes, variables and methods are called identifiers.
  • 13. Java Keywords These are reserved words and may not be used as constant or variable or any other identifier names. Examples: abstract, boolean, break, byte, class, package etc.
  • 14. Comments in Java Java supports single line and multi-line comments very similar to c and c++. All characters available inside any comment are ignored by Java compiler.
  • 15. Using Blank Lines A line containing only whitespace is known as a blank line, and Java ignores it.