SlideShare a Scribd company logo
1 of 15
class A{
public static void main(String args[]){
main method
System.out.println(“My Program”);
The command given to print. A type of a
method
}
}
Key word
Creation of Sajitha Tharaka-
sajithatharaka@gmail.com
Creation of Sajitha Tharaka-
sajithatharaka@gmail.com
package abc;
import java.util.ArrayList;
public class A{
}
class B{
}
class C{
}
Class declaration
More than one non public
Only one Can have many
A.java
If public must
match
Remember Order
PIC
Creation of Sajitha Tharaka-
sajithatharaka@gmail.com
m( ) {
return []; //return statement
}
Return type
Modifiers
Parameter list
m=method name
Creation of Sajitha Tharaka-
sajithatharaka@gmail.com
There can’t be methods
inside methods
First Symbol
Character
$
_
Number
Any combination
No key words
No limit
No spaces
Case sensitive
Creation of Sajitha Tharaka-
sajithatharaka@gmail.com
class A{
public static void main(String args[]){
}
}
Creation of Sajitha Tharaka-
sajithatharaka@gmail.com
machines=methods
factory = class
Creation of Sajitha Tharaka-
sajithatharaka@gmail.com
class A{
}
class B{
}
class C{
public static void main(String args[]){
}
}
D.java
Javac D.java
Java C
int i;
Creation of Sajitha Tharaka-
sajithatharaka@gmail.com
Declaration
i =5; Assignment
int i=5; Declaration and Assignment
Or called Field
int i=5;
Data type
Variable name
Value
Primitive Object
byte
short
int
long
float
double
char
boolean
Creation of Sajitha Tharaka-
sajithatharaka@gmail.com
Classes which
extends the object
class
integers
Floating point
characters
boolean
Creation of Sajitha Tharaka-
sajithatharaka@gmail.com
10 10
byte i=10; int i=10;
Differs from memory allocation in the RAM
float f=3.14;
Double d=3.14;
float f=(float)3.14;
float f=3.14f; // F or f
double d=3.14d; // D or d
Creation of Sajitha Tharaka-
sajithatharaka@gmail.com
Char c=‘a’;
Char c=o – 65535 ;
Char c=‘b’, ‘f’, ‘n’, ‘r’, ‘t’, ‘’’, ‘”’;
Char c=‘u0000’ – ‘uffff’; // unicode values
Char c= -98; // compile error
Char c=(char)-98;
Char c=0x0000 – 0xffff; // hexa values
Creation of Sajitha Tharaka-
sajithatharaka@gmail.com
boolean b=true;
boolean b=true;
boolean b=1;
boolean b=0;
Creation of Sajitha Tharaka-
sajithatharaka@gmail.com
Creation of Sajitha Tharaka-
sajithatharaka@gmail.com
m( ) {
return []; //return statement
}
}
class A{
Like an arm in a
machine
What should be
out put. Data
types are used
There ‘s no return
statement.
Nothing is out put.
Like armless Machine.
Creation of Sajitha Tharaka-
sajithatharaka@gmail.com
static void flag(byte a){
System.out.println("A");
}
static void name(int x){
System.out.println("B");
}
static void age(short y){
System.out.println("C");
}

More Related Content

More from Sajitha Pathirana (11)

Functions
FunctionsFunctions
Functions
 
Databases
DatabasesDatabases
Databases
 
Handling Data in Algorithm
Handling Data in AlgorithmHandling Data in Algorithm
Handling Data in Algorithm
 
Hardware
HardwareHardware
Hardware
 
Pseudocode
PseudocodePseudocode
Pseudocode
 
Communications and Networking
Communications and NetworkingCommunications and Networking
Communications and Networking
 
Software
SoftwareSoftware
Software
 
Logical Operators
Logical OperatorsLogical Operators
Logical Operators
 
Data Representation in Computers
Data Representation in ComputersData Representation in Computers
Data Representation in Computers
 
Fundamentals of computer systems
Fundamentals of computer systemsFundamentals of computer systems
Fundamentals of computer systems
 
Flow Charts
Flow ChartsFlow Charts
Flow Charts
 

Recently uploaded

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 

Recently uploaded (20)

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 

Basics of Java.ppsx

  • 1. class A{ public static void main(String args[]){ main method System.out.println(“My Program”); The command given to print. A type of a method } } Key word Creation of Sajitha Tharaka- sajithatharaka@gmail.com
  • 2. Creation of Sajitha Tharaka- sajithatharaka@gmail.com
  • 3. package abc; import java.util.ArrayList; public class A{ } class B{ } class C{ } Class declaration More than one non public Only one Can have many A.java If public must match Remember Order PIC Creation of Sajitha Tharaka- sajithatharaka@gmail.com
  • 4. m( ) { return []; //return statement } Return type Modifiers Parameter list m=method name Creation of Sajitha Tharaka- sajithatharaka@gmail.com There can’t be methods inside methods
  • 5. First Symbol Character $ _ Number Any combination No key words No limit No spaces Case sensitive Creation of Sajitha Tharaka- sajithatharaka@gmail.com
  • 6. class A{ public static void main(String args[]){ } } Creation of Sajitha Tharaka- sajithatharaka@gmail.com machines=methods factory = class
  • 7. Creation of Sajitha Tharaka- sajithatharaka@gmail.com class A{ } class B{ } class C{ public static void main(String args[]){ } } D.java Javac D.java Java C
  • 8. int i; Creation of Sajitha Tharaka- sajithatharaka@gmail.com Declaration i =5; Assignment int i=5; Declaration and Assignment Or called Field int i=5; Data type Variable name Value
  • 9. Primitive Object byte short int long float double char boolean Creation of Sajitha Tharaka- sajithatharaka@gmail.com Classes which extends the object class integers Floating point characters boolean
  • 10. Creation of Sajitha Tharaka- sajithatharaka@gmail.com 10 10 byte i=10; int i=10; Differs from memory allocation in the RAM
  • 11. float f=3.14; Double d=3.14; float f=(float)3.14; float f=3.14f; // F or f double d=3.14d; // D or d Creation of Sajitha Tharaka- sajithatharaka@gmail.com
  • 12. Char c=‘a’; Char c=o – 65535 ; Char c=‘b’, ‘f’, ‘n’, ‘r’, ‘t’, ‘’’, ‘”’; Char c=‘u0000’ – ‘uffff’; // unicode values Char c= -98; // compile error Char c=(char)-98; Char c=0x0000 – 0xffff; // hexa values Creation of Sajitha Tharaka- sajithatharaka@gmail.com
  • 13. boolean b=true; boolean b=true; boolean b=1; boolean b=0; Creation of Sajitha Tharaka- sajithatharaka@gmail.com
  • 14. Creation of Sajitha Tharaka- sajithatharaka@gmail.com m( ) { return []; //return statement } } class A{ Like an arm in a machine What should be out put. Data types are used
  • 15. There ‘s no return statement. Nothing is out put. Like armless Machine. Creation of Sajitha Tharaka- sajithatharaka@gmail.com static void flag(byte a){ System.out.println("A"); } static void name(int x){ System.out.println("B"); } static void age(short y){ System.out.println("C"); }