SlideShare une entreprise Scribd logo
1  sur  29
Java Language Fundamentals / 1 of 28
Java Language Fundamentals
Session 2
Java Language Fundamentals / 2 of 28
Objectives
 Interpret the Java program
 Understand the basics of the Java language
 Identify data types
Java Language Fundamentals / 3 of 28
Java Program Structure
 Environment Information
 Class Declaration
 Tokens:
 Identifiers
 Keywords / Reserve words
 Separators
 Literals
 Operators
Java Language Fundamentals / 4 of 28
Sample Java program
Java Language Fundamentals / 5 of 28
Compiling and executing the
sample program
Java Language Fundamentals / 6 of 28
Passing Command Line
Arguments (1)
Java Language Fundamentals / 7 of 28
Passing Command Line
Arguments (2)
Java Language Fundamentals / 8 of 28
Basics of the Java Language
 Classes & Methods
 Data types
 Variables
 Operators
 Control structures
Java Language Fundamentals / 9 of 28
Classes in Java
 Class declaration Syntax
class Classname
{
var_datatype variablename;
:
met_datatype methodname(parameter_list)
:
}
Java Language Fundamentals / 10 of 28
Sample class
Java Language Fundamentals / 11 of 28
Nested Classes
Defining one class within another is called
‘Nesting’
Types:
 Static
 Non-static
Java Language Fundamentals / 12 of 28
Data Types
 byte
 char
 boolean
 short
 int
 long
 float
 double
 Array
 Class
 Interface
Java Language Fundamentals / 13 of 28
Type Casting
 One data type is converted into another data
type
 Example
float c = 34.89675f;
int b = (int)c + 10;
Java Language Fundamentals / 14 of 28
Variables
 Three components of a variable declaration:
 Data type
 Name
 Initial value to be assigned (optional)
 Syntax
datatype identifier [=value][, identifier[=value]...];
Java Language Fundamentals / 15 of 28
Java Reserve words
Java Language Fundamentals / 16 of 28
Array Declarations
 Three ways for Array Declaration:
 datatype identifier [ ];
 datatype identifier [ ] = new datatype[size];
 datatype identifier [ ]= {value1,value2,….valueN};
Java Language Fundamentals / 17 of 28
Methods in Classes
 A method is defined as the actual
implementation of an operation on an object
 Syntax
access_specifier modifier datatype method_name(parameter_list)
{
//body of method
}
Java Language Fundamentals / 18 of 28
Sample usage of Method
Java Language Fundamentals / 19 of 28
Access specifiers for Methods
Java Language Fundamentals / 20 of 28
Method Modifiers
 static
 abstract
 final
 native
 synchronized
 volatile
Java Language Fundamentals / 21 of 28
Methods Overloading
 Overloaded Methods:
 Are in the same class
 Have the same name
 Have different parameter lists
 Overloaded methods are a form of compile
time polymorphism
Java Language Fundamentals / 22 of 28
Methods Overriding
 Overridden Methods:
 Are in the superclass as well as the subclass
 Are redefined in the subclass
 Overridden methods are a form of runtime
polymorphism
Java Language Fundamentals / 23 of 28
Class Constructors
 Special method used to initialize member
variables of the class
 Same name as the Class name and does
not have a return type
 Called when an object is created
 Types:
 Explicit constructors
 Implicit constructors
Java Language Fundamentals / 24 of 28
Derived class constructors
 Has the same name as the subclass
 Statement that calls the constructor of the
superclass should be the first statement in
the constructor of a subclass
Java Language Fundamentals / 25 of 28
Operators
Java Provides following categories of Operators:
 Arithmetic Operators
 Bitwise Operators
 Relational Operators
 Logical Operators
 Conditional Operators
 Assignment Operators
Java Language Fundamentals / 26 of 28
Operator Precedence
Java Language Fundamentals / 27 of 28
Escape Sequence
Java Language Fundamentals / 28 of 28
Control Flow
 Decision – making
 if-else statement
 Switch-else statement
 Loops
 while loop
 do-while loop
 for loop
Want to contact Unit Nexus
 Unit Nexus Zirakpur Official Website
 Like Unit Nexus Pvt. Ltd. On Facebook
 Add Unit Nexus to your professional Network
on Linked In
 Company Profile of Unit Nexus
Java Language Fundamentals / 29 of 28

Contenu connexe

Tendances

java interface and packages
java interface and packagesjava interface and packages
java interface and packagesVINOTH R
 
Oops abap fundamental
Oops abap fundamentalOops abap fundamental
Oops abap fundamentalbiswajit2015
 
Chapter 5 declaring classes & oop
Chapter 5 declaring classes  & oopChapter 5 declaring classes  & oop
Chapter 5 declaring classes & oopsshhzap
 
Classes and objects
Classes and objectsClasses and objects
Classes and objectsAnil Kumar
 
Polymorphism presentation in java
Polymorphism presentation in javaPolymorphism presentation in java
Polymorphism presentation in javaAhsan Raja
 
object oriented programming using c++
 object oriented programming using c++ object oriented programming using c++
object oriented programming using c++fasalsial1fasalsial1
 
2 lesson 2 object oriented programming in c++
2 lesson 2 object oriented programming in c++2 lesson 2 object oriented programming in c++
2 lesson 2 object oriented programming in c++Jeff TUYISHIME
 
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaCPD INDIA
 
Inheritance and Polymorphism Java
Inheritance and Polymorphism JavaInheritance and Polymorphism Java
Inheritance and Polymorphism JavaM. Raihan
 
java-06inheritance
java-06inheritancejava-06inheritance
java-06inheritanceArjun Shanka
 
Inheritance in JAVA PPT
Inheritance  in JAVA PPTInheritance  in JAVA PPT
Inheritance in JAVA PPTPooja Jaiswal
 
Data Types & Variables in JAVA
Data Types & Variables in JAVAData Types & Variables in JAVA
Data Types & Variables in JAVAAnkita Totala
 

Tendances (20)

java interface and packages
java interface and packagesjava interface and packages
java interface and packages
 
Oops abap fundamental
Oops abap fundamentalOops abap fundamental
Oops abap fundamental
 
Basics of Java
Basics of JavaBasics of Java
Basics of Java
 
Chapter 5 declaring classes & oop
Chapter 5 declaring classes  & oopChapter 5 declaring classes  & oop
Chapter 5 declaring classes & oop
 
Lecture 8 Library classes
Lecture 8 Library classesLecture 8 Library classes
Lecture 8 Library classes
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
 
C# Basics
C# BasicsC# Basics
C# Basics
 
Unit 3 Java
Unit 3 JavaUnit 3 Java
Unit 3 Java
 
Polymorphism presentation in java
Polymorphism presentation in javaPolymorphism presentation in java
Polymorphism presentation in java
 
Polymorphism in java
Polymorphism in javaPolymorphism in java
Polymorphism in java
 
object oriented programming using c++
 object oriented programming using c++ object oriented programming using c++
object oriented programming using c++
 
2 lesson 2 object oriented programming in c++
2 lesson 2 object oriented programming in c++2 lesson 2 object oriented programming in c++
2 lesson 2 object oriented programming in c++
 
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in java
 
Inheritance and Polymorphism Java
Inheritance and Polymorphism JavaInheritance and Polymorphism Java
Inheritance and Polymorphism Java
 
Inheritance
InheritanceInheritance
Inheritance
 
Oop in kotlin
Oop in kotlinOop in kotlin
Oop in kotlin
 
java-06inheritance
java-06inheritancejava-06inheritance
java-06inheritance
 
Java interfaces
Java interfacesJava interfaces
Java interfaces
 
Inheritance in JAVA PPT
Inheritance  in JAVA PPTInheritance  in JAVA PPT
Inheritance in JAVA PPT
 
Data Types & Variables in JAVA
Data Types & Variables in JAVAData Types & Variables in JAVA
Data Types & Variables in JAVA
 

En vedette

News is something that we listen to
News is something that we listen toNews is something that we listen to
News is something that we listen togreatnewsupdate
 
Problem statement final
Problem statement finalProblem statement final
Problem statement finalmorgannross01
 
Staging presentation for_prezi
Staging presentation for_preziStaging presentation for_prezi
Staging presentation for_preziRobin Leigh
 
Hướng dẫn sử dụng máy Photocopy Toshiba e35
Hướng dẫn sử dụng máy Photocopy Toshiba e35Hướng dẫn sử dụng máy Photocopy Toshiba e35
Hướng dẫn sử dụng máy Photocopy Toshiba e35banbanbuonbuon
 
VICTORY WE
VICTORY WEVICTORY WE
VICTORY WEkpranjul
 
Primera presentacion tic
Primera presentacion ticPrimera presentacion tic
Primera presentacion ticMercedes Rolon
 
Empathy map 2013
Empathy map   2013Empathy map   2013
Empathy map 2013MartynaRz
 
Harley davidson india
Harley davidson indiaHarley davidson india
Harley davidson indiaVikas Gurudu
 
Empathize and Define
Empathize and DefineEmpathize and Define
Empathize and Definespaschke11
 
Assignment 8 2_prototypes - copy
Assignment 8 2_prototypes - copyAssignment 8 2_prototypes - copy
Assignment 8 2_prototypes - copyBishoy Saeed
 
OPERATIONS RESEARCH (OR)CLASSES
OPERATIONS RESEARCH (OR)CLASSES OPERATIONS RESEARCH (OR)CLASSES
OPERATIONS RESEARCH (OR)CLASSES SOURAV DAS
 
What do we stand for
What do we stand forWhat do we stand for
What do we stand forec2926
 
GAME THEORY NOTES FOR ECONOMICS HONOURS FOR ALL UNIVERSITIES BY SOURAV SIR'S ...
GAME THEORY NOTES FOR ECONOMICS HONOURS FOR ALL UNIVERSITIES BY SOURAV SIR'S ...GAME THEORY NOTES FOR ECONOMICS HONOURS FOR ALL UNIVERSITIES BY SOURAV SIR'S ...
GAME THEORY NOTES FOR ECONOMICS HONOURS FOR ALL UNIVERSITIES BY SOURAV SIR'S ...SOURAV DAS
 

En vedette (20)

Java basic
Java basicJava basic
Java basic
 
News is something that we listen to
News is something that we listen toNews is something that we listen to
News is something that we listen to
 
Prototypes
PrototypesPrototypes
Prototypes
 
Problem statement final
Problem statement finalProblem statement final
Problem statement final
 
Staging presentation for_prezi
Staging presentation for_preziStaging presentation for_prezi
Staging presentation for_prezi
 
Hướng dẫn sử dụng máy Photocopy Toshiba e35
Hướng dẫn sử dụng máy Photocopy Toshiba e35Hướng dẫn sử dụng máy Photocopy Toshiba e35
Hướng dẫn sử dụng máy Photocopy Toshiba e35
 
Diapositivas
DiapositivasDiapositivas
Diapositivas
 
How to add babblr
How to add babblrHow to add babblr
How to add babblr
 
Diapositivas
DiapositivasDiapositivas
Diapositivas
 
VICTORY WE
VICTORY WEVICTORY WE
VICTORY WE
 
Primera presentacion tic
Primera presentacion ticPrimera presentacion tic
Primera presentacion tic
 
Empathy map 2013
Empathy map   2013Empathy map   2013
Empathy map 2013
 
Client review unit nexus
Client review unit nexusClient review unit nexus
Client review unit nexus
 
Harley davidson india
Harley davidson indiaHarley davidson india
Harley davidson india
 
Empathize and Define
Empathize and DefineEmpathize and Define
Empathize and Define
 
Assignment 8 2_prototypes - copy
Assignment 8 2_prototypes - copyAssignment 8 2_prototypes - copy
Assignment 8 2_prototypes - copy
 
OPERATIONS RESEARCH (OR)CLASSES
OPERATIONS RESEARCH (OR)CLASSES OPERATIONS RESEARCH (OR)CLASSES
OPERATIONS RESEARCH (OR)CLASSES
 
Instructivo tablet MINEDU
Instructivo tablet MINEDUInstructivo tablet MINEDU
Instructivo tablet MINEDU
 
What do we stand for
What do we stand forWhat do we stand for
What do we stand for
 
GAME THEORY NOTES FOR ECONOMICS HONOURS FOR ALL UNIVERSITIES BY SOURAV SIR'S ...
GAME THEORY NOTES FOR ECONOMICS HONOURS FOR ALL UNIVERSITIES BY SOURAV SIR'S ...GAME THEORY NOTES FOR ECONOMICS HONOURS FOR ALL UNIVERSITIES BY SOURAV SIR'S ...
GAME THEORY NOTES FOR ECONOMICS HONOURS FOR ALL UNIVERSITIES BY SOURAV SIR'S ...
 

Similaire à Learn Java language fundamentals with Unit nexus

INDUMATHY- UNIT 1 cs3391 oops introduction to oop and java.pptx
INDUMATHY- UNIT 1 cs3391 oops introduction to oop and java.pptxINDUMATHY- UNIT 1 cs3391 oops introduction to oop and java.pptx
INDUMATHY- UNIT 1 cs3391 oops introduction to oop and java.pptxIndu65
 
Basics of java 2
Basics of java 2Basics of java 2
Basics of java 2Raghu nath
 
Android Training (Java Review)
Android Training (Java Review)Android Training (Java Review)
Android Training (Java Review)Khaled Anaqwa
 
Object Oriented Principles
Object Oriented PrinciplesObject Oriented Principles
Object Oriented PrinciplesSujit Majety
 
Lecture - 3 Variables-data type_operators_oops concept
Lecture - 3 Variables-data type_operators_oops conceptLecture - 3 Variables-data type_operators_oops concept
Lecture - 3 Variables-data type_operators_oops conceptmanish kumar
 
4. java intro class
4. java intro class4. java intro class
4. java intro classQuan Ho
 
Generics and collections in Java
Generics and collections in JavaGenerics and collections in Java
Generics and collections in JavaGurpreet singh
 
Abap Inicio
Abap InicioAbap Inicio
Abap Iniciounifor
 
In this page, we will learn about the basics of OOPs. Object-Oriented Program...
In this page, we will learn about the basics of OOPs. Object-Oriented Program...In this page, we will learn about the basics of OOPs. Object-Oriented Program...
In this page, we will learn about the basics of OOPs. Object-Oriented Program...Indu32
 
Java 8 presentation
Java 8 presentationJava 8 presentation
Java 8 presentationVan Huong
 
Ap Power Point Chpt4
Ap Power Point Chpt4Ap Power Point Chpt4
Ap Power Point Chpt4dplunkett
 
The Java Learning Kit Chapter 5 – Methods and Modular.docx
The Java Learning Kit Chapter 5 – Methods and Modular.docxThe Java Learning Kit Chapter 5 – Methods and Modular.docx
The Java Learning Kit Chapter 5 – Methods and Modular.docxarnoldmeredith47041
 

Similaire à Learn Java language fundamentals with Unit nexus (20)

INDUMATHY- UNIT 1 cs3391 oops introduction to oop and java.pptx
INDUMATHY- UNIT 1 cs3391 oops introduction to oop and java.pptxINDUMATHY- UNIT 1 cs3391 oops introduction to oop and java.pptx
INDUMATHY- UNIT 1 cs3391 oops introduction to oop and java.pptx
 
Basics of java 2
Basics of java 2Basics of java 2
Basics of java 2
 
Android Training (Java Review)
Android Training (Java Review)Android Training (Java Review)
Android Training (Java Review)
 
Object Oriented Principles
Object Oriented PrinciplesObject Oriented Principles
Object Oriented Principles
 
PCSTt11 overview of java
PCSTt11 overview of javaPCSTt11 overview of java
PCSTt11 overview of java
 
BIT211_3.pdf
BIT211_3.pdfBIT211_3.pdf
BIT211_3.pdf
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Lecture - 3 Variables-data type_operators_oops concept
Lecture - 3 Variables-data type_operators_oops conceptLecture - 3 Variables-data type_operators_oops concept
Lecture - 3 Variables-data type_operators_oops concept
 
4. java intro class
4. java intro class4. java intro class
4. java intro class
 
Classes objects in java
Classes objects in javaClasses objects in java
Classes objects in java
 
Generics and collections in Java
Generics and collections in JavaGenerics and collections in Java
Generics and collections in Java
 
M C6java3
M C6java3M C6java3
M C6java3
 
Java
JavaJava
Java
 
Abap Inicio
Abap InicioAbap Inicio
Abap Inicio
 
In this page, we will learn about the basics of OOPs. Object-Oriented Program...
In this page, we will learn about the basics of OOPs. Object-Oriented Program...In this page, we will learn about the basics of OOPs. Object-Oriented Program...
In this page, we will learn about the basics of OOPs. Object-Oriented Program...
 
Java q ref 2018
Java q ref 2018Java q ref 2018
Java q ref 2018
 
VB.net
VB.netVB.net
VB.net
 
Java 8 presentation
Java 8 presentationJava 8 presentation
Java 8 presentation
 
Ap Power Point Chpt4
Ap Power Point Chpt4Ap Power Point Chpt4
Ap Power Point Chpt4
 
The Java Learning Kit Chapter 5 – Methods and Modular.docx
The Java Learning Kit Chapter 5 – Methods and Modular.docxThe Java Learning Kit Chapter 5 – Methods and Modular.docx
The Java Learning Kit Chapter 5 – Methods and Modular.docx
 

Plus de Unit Nexus Pvt. Ltd.

Plus de Unit Nexus Pvt. Ltd. (7)

Session4 applets
Session4   appletsSession4   applets
Session4 applets
 
AWT information
AWT informationAWT information
AWT information
 
introduction to java-final with Unit Nexus
introduction to java-final with Unit Nexus introduction to java-final with Unit Nexus
introduction to java-final with Unit Nexus
 
Unit Nexus offering Java ring training
Unit Nexus offering Java ring trainingUnit Nexus offering Java ring training
Unit Nexus offering Java ring training
 
Core Java tutorial at Unit Nexus
Core Java tutorial at Unit NexusCore Java tutorial at Unit Nexus
Core Java tutorial at Unit Nexus
 
Unit nexus school presentation
Unit nexus school presentationUnit nexus school presentation
Unit nexus school presentation
 
Unit Nexus Pvt- Ltd-Company profile unipl
Unit Nexus Pvt- Ltd-Company profile uniplUnit Nexus Pvt- Ltd-Company profile unipl
Unit Nexus Pvt- Ltd-Company profile unipl
 

Dernier

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
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
 
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
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
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
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 

Dernier (20)

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
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
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
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
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
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
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 

Learn Java language fundamentals with Unit nexus

  • 1. Java Language Fundamentals / 1 of 28 Java Language Fundamentals Session 2
  • 2. Java Language Fundamentals / 2 of 28 Objectives  Interpret the Java program  Understand the basics of the Java language  Identify data types
  • 3. Java Language Fundamentals / 3 of 28 Java Program Structure  Environment Information  Class Declaration  Tokens:  Identifiers  Keywords / Reserve words  Separators  Literals  Operators
  • 4. Java Language Fundamentals / 4 of 28 Sample Java program
  • 5. Java Language Fundamentals / 5 of 28 Compiling and executing the sample program
  • 6. Java Language Fundamentals / 6 of 28 Passing Command Line Arguments (1)
  • 7. Java Language Fundamentals / 7 of 28 Passing Command Line Arguments (2)
  • 8. Java Language Fundamentals / 8 of 28 Basics of the Java Language  Classes & Methods  Data types  Variables  Operators  Control structures
  • 9. Java Language Fundamentals / 9 of 28 Classes in Java  Class declaration Syntax class Classname { var_datatype variablename; : met_datatype methodname(parameter_list) : }
  • 10. Java Language Fundamentals / 10 of 28 Sample class
  • 11. Java Language Fundamentals / 11 of 28 Nested Classes Defining one class within another is called ‘Nesting’ Types:  Static  Non-static
  • 12. Java Language Fundamentals / 12 of 28 Data Types  byte  char  boolean  short  int  long  float  double  Array  Class  Interface
  • 13. Java Language Fundamentals / 13 of 28 Type Casting  One data type is converted into another data type  Example float c = 34.89675f; int b = (int)c + 10;
  • 14. Java Language Fundamentals / 14 of 28 Variables  Three components of a variable declaration:  Data type  Name  Initial value to be assigned (optional)  Syntax datatype identifier [=value][, identifier[=value]...];
  • 15. Java Language Fundamentals / 15 of 28 Java Reserve words
  • 16. Java Language Fundamentals / 16 of 28 Array Declarations  Three ways for Array Declaration:  datatype identifier [ ];  datatype identifier [ ] = new datatype[size];  datatype identifier [ ]= {value1,value2,….valueN};
  • 17. Java Language Fundamentals / 17 of 28 Methods in Classes  A method is defined as the actual implementation of an operation on an object  Syntax access_specifier modifier datatype method_name(parameter_list) { //body of method }
  • 18. Java Language Fundamentals / 18 of 28 Sample usage of Method
  • 19. Java Language Fundamentals / 19 of 28 Access specifiers for Methods
  • 20. Java Language Fundamentals / 20 of 28 Method Modifiers  static  abstract  final  native  synchronized  volatile
  • 21. Java Language Fundamentals / 21 of 28 Methods Overloading  Overloaded Methods:  Are in the same class  Have the same name  Have different parameter lists  Overloaded methods are a form of compile time polymorphism
  • 22. Java Language Fundamentals / 22 of 28 Methods Overriding  Overridden Methods:  Are in the superclass as well as the subclass  Are redefined in the subclass  Overridden methods are a form of runtime polymorphism
  • 23. Java Language Fundamentals / 23 of 28 Class Constructors  Special method used to initialize member variables of the class  Same name as the Class name and does not have a return type  Called when an object is created  Types:  Explicit constructors  Implicit constructors
  • 24. Java Language Fundamentals / 24 of 28 Derived class constructors  Has the same name as the subclass  Statement that calls the constructor of the superclass should be the first statement in the constructor of a subclass
  • 25. Java Language Fundamentals / 25 of 28 Operators Java Provides following categories of Operators:  Arithmetic Operators  Bitwise Operators  Relational Operators  Logical Operators  Conditional Operators  Assignment Operators
  • 26. Java Language Fundamentals / 26 of 28 Operator Precedence
  • 27. Java Language Fundamentals / 27 of 28 Escape Sequence
  • 28. Java Language Fundamentals / 28 of 28 Control Flow  Decision – making  if-else statement  Switch-else statement  Loops  while loop  do-while loop  for loop
  • 29. Want to contact Unit Nexus  Unit Nexus Zirakpur Official Website  Like Unit Nexus Pvt. Ltd. On Facebook  Add Unit Nexus to your professional Network on Linked In  Company Profile of Unit Nexus Java Language Fundamentals / 29 of 28