SlideShare une entreprise Scribd logo
1  sur  4
Télécharger pour lire hors ligne
Core Java

Debasish Pratihari

Java File Structure :



An optional package directive



Zero or more import directive



One or more Class definition

Java Keywords :
abstract
switch
package
if
double
byte
throws
return
int
final
class
volatile
super

continue
assert
synchronized
private
implements
else
case
transient
short
interface
finally
const *
while

for
default
boolean
this
protected
import
enum
catch
try
static
long
float

new
goto *
do
break
throw
public
instanceof
extends
char
void
strictfp
native

Note:
The * marked keywords
are reserved keywords.
They may be in action in
future.

Variable :



A variable is a named memory location that is
used to store information.
It is able to store data only of one particular
type

Literals :



Explicit data values present in the program.
Each literal is of a particular type.

Lecture/core/LF1/04

Page #1

feel the Technology…
Core Java

Debasish Pratihari

Identifier :








The name given for anything in java
Example- variable name, method name, class
name etc.
It must start with a letter, an underscore( _ ),
or dollar sign( $ ).
It can’t include operator of java.
Is case sensitive.
It must not be a java keyword.
White space is not allowed in identifiers

Primitive Types :


A primitive types is pre-defined by the language
and is named by reserved keywords.

Primitives Types in Java :

Lecture/core/LF1/04

Page #2

feel the Technology…
Core Java

Debasish Pratihari

Default Values :

Note : Compilers never assign a value to local variables of
a class. So they must be initialized explicitly before use.

Examples of Literals :
25%

boolean flag = true;
char c = 'D';
byte b = 100;
short s = 10000;
int i = 100000;

Note:
 new keyword isn't used when initializing a variable
of a primitive type. Primitive types are special data
types built into the language


A literal is the source code representation of a fixed
value

Literals in the form of octal and Hexa :


The integral types (byte, short, int, and long)
can be expressed using decimal, octal, or
hexadecimal number systems.

Examples:
int value = 10;
int value = 012;
int value = 0x0a;

Lecture/core/LF1/04

// The number 10, in decimal
// The number 10, in octal
// Then number 10, in Hexadecimal

Page #3

feel the Technology…
Core Java

Debasish Pratihari

Operators :



Operators are special symbols that perform
specific operations on one, two, or three
operands, and then return a result.

Comments :


Comments should be used to give overviews of
code and provide additional information that is
not readily available in the code itself.
Comments should contain only information that
is relevant to reading and understanding the
program.

Java Comment Conventions :






Block comment
Single-Line Comment
Trailing Comment
End-of-Line Comment
Documentation Comment

Lecture/core/LF1/04

Page #4

feel the Technology…

Contenu connexe

Tendances

Object Oriented Programming lecture 1
Object Oriented Programming lecture 1Object Oriented Programming lecture 1
Object Oriented Programming lecture 1
Anwar Ul Haq
 

Tendances (20)

Structured Languages
Structured LanguagesStructured Languages
Structured Languages
 
Csharp4 basics
Csharp4 basicsCsharp4 basics
Csharp4 basics
 
The Go Programing Language 1
The Go Programing Language 1The Go Programing Language 1
The Go Programing Language 1
 
Primitive data types
Primitive data typesPrimitive data types
Primitive data types
 
Object Oriented Programming lecture 1
Object Oriented Programming lecture 1Object Oriented Programming lecture 1
Object Oriented Programming lecture 1
 
Java Datatypes
Java DatatypesJava Datatypes
Java Datatypes
 
Primitive data types in java
Primitive data types in javaPrimitive data types in java
Primitive data types in java
 
Course outline for c programming
Course outline for c  programming Course outline for c  programming
Course outline for c programming
 
Javanotes
JavanotesJavanotes
Javanotes
 
C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#C# lecture 2: Literals , Variables and Data Types in C#
C# lecture 2: Literals , Variables and Data Types in C#
 
Md03 - part3
Md03 - part3Md03 - part3
Md03 - part3
 
Programming Fundamentals With OOPs Concepts (Java Examples Based)
Programming Fundamentals With OOPs Concepts (Java Examples Based)Programming Fundamentals With OOPs Concepts (Java Examples Based)
Programming Fundamentals With OOPs Concepts (Java Examples Based)
 
Java Data Types and Variables
Java Data Types and VariablesJava Data Types and Variables
Java Data Types and Variables
 
Introduction to c++
Introduction to c++Introduction to c++
Introduction to c++
 
Java platform
Java platformJava platform
Java platform
 
Data types
Data typesData types
Data types
 
What are variables and keywords in c++
What are variables and keywords in c++What are variables and keywords in c++
What are variables and keywords in c++
 
PCSTt11 overview of java
PCSTt11 overview of javaPCSTt11 overview of java
PCSTt11 overview of java
 
Lecture02 java
Lecture02 javaLecture02 java
Lecture02 java
 
Why Java is not a purely object oriented language?
Why Java is not a purely object oriented language?Why Java is not a purely object oriented language?
Why Java is not a purely object oriented language?
 

En vedette

Blog Ict 1
Blog Ict 1Blog Ict 1
Blog Ict 1
amoi286
 
Learning Pool Webinar: Brand new new authoring tool templates
Learning Pool Webinar: Brand new new authoring tool templatesLearning Pool Webinar: Brand new new authoring tool templates
Learning Pool Webinar: Brand new new authoring tool templates
Paul McElvaney
 
Coral Exodo - 06.05.07
Coral Exodo - 06.05.07Coral Exodo - 06.05.07
Coral Exodo - 06.05.07
Jubrac Jacui
 
Presentatie Marcel Seijner T L N Leden Congres 24 Januari 2009
Presentatie  Marcel  Seijner  T L N Leden Congres 24 Januari 2009Presentatie  Marcel  Seijner  T L N Leden Congres 24 Januari 2009
Presentatie Marcel Seijner T L N Leden Congres 24 Januari 2009
Marcel Seijner
 
Learning Pool Webinar: DLE Examples
Learning Pool Webinar: DLE Examples Learning Pool Webinar: DLE Examples
Learning Pool Webinar: DLE Examples
Paul McElvaney
 
Db tips & tricks django meetup
Db tips & tricks django meetupDb tips & tricks django meetup
Db tips & tricks django meetup
zeeg
 

En vedette (20)

Starterslift 17 februari
Starterslift 17 februariStarterslift 17 februari
Starterslift 17 februari
 
Workshop logeion 1004 webversie
Workshop logeion 1004 webversieWorkshop logeion 1004 webversie
Workshop logeion 1004 webversie
 
Scenario exercise 2014 mid atlantic technical communication conference DDeBoard
Scenario exercise 2014 mid atlantic technical communication conference DDeBoardScenario exercise 2014 mid atlantic technical communication conference DDeBoard
Scenario exercise 2014 mid atlantic technical communication conference DDeBoard
 
Introduction to open - libre Tools and Formats
Introduction to open - libre Tools and FormatsIntroduction to open - libre Tools and Formats
Introduction to open - libre Tools and Formats
 
Communication
CommunicationCommunication
Communication
 
Kako uspešno primeniti e-učenje
Kako uspešno primeniti e-učenjeKako uspešno primeniti e-učenje
Kako uspešno primeniti e-učenje
 
Blog Ict 1
Blog Ict 1Blog Ict 1
Blog Ict 1
 
Learning Pool Webinar: Brand new new authoring tool templates
Learning Pool Webinar: Brand new new authoring tool templatesLearning Pool Webinar: Brand new new authoring tool templates
Learning Pool Webinar: Brand new new authoring tool templates
 
Inbox Zero
Inbox ZeroInbox Zero
Inbox Zero
 
Perritos
PerritosPerritos
Perritos
 
Massao - 10.06.07
Massao - 10.06.07Massao - 10.06.07
Massao - 10.06.07
 
Coral Exodo - 06.05.07
Coral Exodo - 06.05.07Coral Exodo - 06.05.07
Coral Exodo - 06.05.07
 
Pattern Learning
Pattern LearningPattern Learning
Pattern Learning
 
Lecture 18
Lecture 18Lecture 18
Lecture 18
 
Presentatie Marcel Seijner T L N Leden Congres 24 Januari 2009
Presentatie  Marcel  Seijner  T L N Leden Congres 24 Januari 2009Presentatie  Marcel  Seijner  T L N Leden Congres 24 Januari 2009
Presentatie Marcel Seijner T L N Leden Congres 24 Januari 2009
 
Ucapan gb
Ucapan gbUcapan gb
Ucapan gb
 
Workshop Personal branding Avans 27 mei
Workshop Personal branding Avans 27 meiWorkshop Personal branding Avans 27 mei
Workshop Personal branding Avans 27 mei
 
Learning Pool Webinar: DLE Examples
Learning Pool Webinar: DLE Examples Learning Pool Webinar: DLE Examples
Learning Pool Webinar: DLE Examples
 
Db tips & tricks django meetup
Db tips & tricks django meetupDb tips & tricks django meetup
Db tips & tricks django meetup
 
Lecture 22
Lecture 22Lecture 22
Lecture 22
 

Similaire à Lecture 4

Java (1).ppt seminar topics engineering
Java (1).ppt  seminar topics engineeringJava (1).ppt  seminar topics engineering
Java (1).ppt seminar topics engineering
4MU21CS023
 
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
SURBHI SAROHA
 
Introduction to Java Object Oiented Concepts and Basic terminologies
Introduction to Java Object Oiented Concepts and Basic terminologiesIntroduction to Java Object Oiented Concepts and Basic terminologies
Introduction to Java Object Oiented Concepts and Basic terminologies
TabassumMaktum
 

Similaire à Lecture 4 (20)

Introduction to-programming
Introduction to-programmingIntroduction to-programming
Introduction to-programming
 
Java fundamentals
Java fundamentalsJava fundamentals
Java fundamentals
 
Java Tokens
Java  TokensJava  Tokens
Java Tokens
 
java
java java
java
 
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
 
Lecture2_MCS4_Evening.pptx
Lecture2_MCS4_Evening.pptxLecture2_MCS4_Evening.pptx
Lecture2_MCS4_Evening.pptx
 
dizital pods session 2.pptx
dizital pods session 2.pptxdizital pods session 2.pptx
dizital pods session 2.pptx
 
Basic
BasicBasic
Basic
 
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
 
Java (1).ppt seminar topics engineering
Java (1).ppt  seminar topics engineeringJava (1).ppt  seminar topics engineering
Java (1).ppt seminar topics engineering
 
C keywords and identifiers
C keywords and identifiersC keywords and identifiers
C keywords and identifiers
 
Dot net programming concept
Dot net  programming conceptDot net  programming concept
Dot net programming concept
 
Introduction to JAVA
Introduction to JAVAIntroduction to JAVA
Introduction to JAVA
 
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
 
Language tour of dart
Language tour of dartLanguage tour of dart
Language tour of dart
 
Introduction to Python for Data Science and Machine Learning
Introduction to Python for Data Science and Machine Learning Introduction to Python for Data Science and Machine Learning
Introduction to Python for Data Science and Machine Learning
 
Concepts of core java
Concepts of core javaConcepts of core java
Concepts of core java
 
Data Types, Variables, and Operators
Data Types, Variables, and OperatorsData Types, Variables, and Operators
Data Types, Variables, and Operators
 
Introduction to Java Object Oiented Concepts and Basic terminologies
Introduction to Java Object Oiented Concepts and Basic terminologiesIntroduction to Java Object Oiented Concepts and Basic terminologies
Introduction to Java Object Oiented Concepts and Basic terminologies
 
Unit 2 python
Unit 2 pythonUnit 2 python
Unit 2 python
 

Plus de Debasish Pratihari (18)

Lecture 24
Lecture 24Lecture 24
Lecture 24
 
Lecture 23
Lecture 23Lecture 23
Lecture 23
 
Lecture 21
Lecture 21Lecture 21
Lecture 21
 
Lecture 20
Lecture 20Lecture 20
Lecture 20
 
Lecture 19
Lecture 19Lecture 19
Lecture 19
 
Lecture 17
Lecture 17Lecture 17
Lecture 17
 
Lecture 16
Lecture 16Lecture 16
Lecture 16
 
Lecture 14
Lecture 14Lecture 14
Lecture 14
 
Lecture 10
Lecture 10Lecture 10
Lecture 10
 
Lecture 9
Lecture 9Lecture 9
Lecture 9
 
Lecture 8
Lecture 8Lecture 8
Lecture 8
 
Lecture 7
Lecture 7Lecture 7
Lecture 7
 
Lecture 6
Lecture 6Lecture 6
Lecture 6
 
Lecture 5
Lecture 5Lecture 5
Lecture 5
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
Lecture25
Lecture25Lecture25
Lecture25
 

Dernier

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

Lecture 4

  • 1. Core Java Debasish Pratihari Java File Structure :  An optional package directive  Zero or more import directive  One or more Class definition Java Keywords : abstract switch package if double byte throws return int final class volatile super continue assert synchronized private implements else case transient short interface finally const * while for default boolean this protected import enum catch try static long float new goto * do break throw public instanceof extends char void strictfp native Note: The * marked keywords are reserved keywords. They may be in action in future. Variable :   A variable is a named memory location that is used to store information. It is able to store data only of one particular type Literals :   Explicit data values present in the program. Each literal is of a particular type. Lecture/core/LF1/04 Page #1 feel the Technology…
  • 2. Core Java Debasish Pratihari Identifier :        The name given for anything in java Example- variable name, method name, class name etc. It must start with a letter, an underscore( _ ), or dollar sign( $ ). It can’t include operator of java. Is case sensitive. It must not be a java keyword. White space is not allowed in identifiers Primitive Types :  A primitive types is pre-defined by the language and is named by reserved keywords. Primitives Types in Java : Lecture/core/LF1/04 Page #2 feel the Technology…
  • 3. Core Java Debasish Pratihari Default Values : Note : Compilers never assign a value to local variables of a class. So they must be initialized explicitly before use. Examples of Literals : 25% boolean flag = true; char c = 'D'; byte b = 100; short s = 10000; int i = 100000; Note:  new keyword isn't used when initializing a variable of a primitive type. Primitive types are special data types built into the language  A literal is the source code representation of a fixed value Literals in the form of octal and Hexa :  The integral types (byte, short, int, and long) can be expressed using decimal, octal, or hexadecimal number systems. Examples: int value = 10; int value = 012; int value = 0x0a; Lecture/core/LF1/04 // The number 10, in decimal // The number 10, in octal // Then number 10, in Hexadecimal Page #3 feel the Technology…
  • 4. Core Java Debasish Pratihari Operators :  Operators are special symbols that perform specific operations on one, two, or three operands, and then return a result. Comments :  Comments should be used to give overviews of code and provide additional information that is not readily available in the code itself. Comments should contain only information that is relevant to reading and understanding the program. Java Comment Conventions :      Block comment Single-Line Comment Trailing Comment End-of-Line Comment Documentation Comment Lecture/core/LF1/04 Page #4 feel the Technology…