SlideShare ist ein Scribd-Unternehmen logo
1 von 12
For Beginners
Class
A class depicts a specific sort of article. It can contain related strategies and information
individuals (variables).
A class must have the same name as the document it is contained in.
Eg:
public class myClass(){
//data members
//constructors
//methods
}
Constructor
A special type of instance system that makes another item. In Java, constructors have the same
name as their class and have no arrival esteem in their presentation.
Eg:
public class myClass{
// a constructor that takes no parameters
public myClass(){
}
// a constructor that takes one parameter
public myClass(int var){
}
}
Declaration
An statement that makes a variable, system, or class identifier and its related traits
however doesn't fundamentally distribute capacity for variables or characterize an
execution for strategies.
Class can't be declared and afterward have its body defined somewhere else.
Eg1: the variable var is declared
int var;
Eg 2: the object myObject is declared as an instance of the MyClass class.
MyClass myObject;
Eg 3: abstract methods, found in abstract classes, can be declared but not defined.
public abstract class myAbstractClass(){
// abstract methods are declared.
public abstract myMethod()
}
Eg 4: methods found in interfaces can be declared but not defined.
public interface myInterface(){
// methods in an interface are declared
public void myMethod();
}
Method
A collection of code found within a class. If the data members of a class are nouns, the
methods are the verbs (the action).
Eg 1: a method, myMethod is defined within class myClass that does NOT return a value.
public class myClass{
public void myMethod(){
}
}
Method
Eg 2: a method, myMethod is defined within class myClass that returns a
boolean.
public class myClass{
public boolean myMethod(){
return true;
}
}
Object
The principal code building block of Java programs. Each object in a program
consists of both variables (data) and methods (functionality).
Parameter – a variable or object passed into a method.
Eg 1: a method, myMethod is defined which takes 2 parameters.
public class MyClass{
public void myMethod(int var1, double var2){
}
}
Eg 2:
myMethod is called.
int myInteger = 2;
double myDouble = 5.0;
myMethod(myInteger, myDouble);
Primitive
A variable defined with a primitive data type: byte, short, int, long, float,
double, char, or boolean.
Typecast – (1) to demote a variable from a larger capacity data type to a smaller one.
(2) to re-establish the class of an object. The cast associates itself with the expression
to its immediate right.
Eg 1: A double var is created and then typecast via “(int)” to a variable of integer
type ans.
double var = 3;
int ans = (int) var;
Eg 2: All objects extend the Java Object class.
// define class MyClass in file MyClass.java
public class MyClass{}
// in the main method of another class…
// instantiate MyClass, but store it in a variable of type Object.
Object o = new MyClass();
// typecast object o, back into an instance of MyClass.
MyClass myObject = (MyClass) o;
Java Training in
Kerala
Cozak Technologies
Ernakulam, Thrissur, Palakkad& Trivandrum
E-mail: mail@cozaktechnologies.in
Website: www.cozaktechnologies.in
Tel: 0491 2553320, 0484 6053320
Mobile: +91 9037 427 420,+91 9037 428 420, +91 9037 429 420
Java projects and Training Kerala| Web developers| Mobile app development,etc

Weitere ähnliche Inhalte

Andere mochten auch

Sydney VR Meetup #8 Pres
Sydney VR Meetup #8 PresSydney VR Meetup #8 Pres
Sydney VR Meetup #8 PresKain Tietzel
 
7 resolución 242 2000 póliza de seguro de accidentes personales
7 resolución 242 2000 póliza de seguro de accidentes personales7 resolución 242 2000 póliza de seguro de accidentes personales
7 resolución 242 2000 póliza de seguro de accidentes personalesAseguradora Rural
 
Mercadeo y Ventas en el Sector Funerario
Mercadeo y Ventas en el Sector FunerarioMercadeo y Ventas en el Sector Funerario
Mercadeo y Ventas en el Sector FunerarioFenalco Antioquia
 
Working with Private Equity
Working with Private EquityWorking with Private Equity
Working with Private EquityJames Darnell
 
[STRUAN TEAGUE] [SAY SOMETHING]
[STRUAN TEAGUE] [SAY SOMETHING][STRUAN TEAGUE] [SAY SOMETHING]
[STRUAN TEAGUE] [SAY SOMETHING]CORREDORESDEIDEAS
 
Social Media & Recht – Dr. Martin Schirmbacher, Fachanwalt für IT-Recht
Social Media & Recht – Dr. Martin Schirmbacher, Fachanwalt für IT-RechtSocial Media & Recht – Dr. Martin Schirmbacher, Fachanwalt für IT-Recht
Social Media & Recht – Dr. Martin Schirmbacher, Fachanwalt für IT-RechtMANDARIN MEDIEN GmbH
 
Torque QA Webinar Slides
Torque QA Webinar SlidesTorque QA Webinar Slides
Torque QA Webinar SlidesInterface Inc.
 

Andere mochten auch (10)

Profesor(a) imagenes
Profesor(a)  imagenesProfesor(a)  imagenes
Profesor(a) imagenes
 
Sydney VR Meetup #8 Pres
Sydney VR Meetup #8 PresSydney VR Meetup #8 Pres
Sydney VR Meetup #8 Pres
 
7 resolución 242 2000 póliza de seguro de accidentes personales
7 resolución 242 2000 póliza de seguro de accidentes personales7 resolución 242 2000 póliza de seguro de accidentes personales
7 resolución 242 2000 póliza de seguro de accidentes personales
 
Mercadeo y Ventas en el Sector Funerario
Mercadeo y Ventas en el Sector FunerarioMercadeo y Ventas en el Sector Funerario
Mercadeo y Ventas en el Sector Funerario
 
Working with Private Equity
Working with Private EquityWorking with Private Equity
Working with Private Equity
 
Enlace Ciudadano Nro. 225 - Emelec
Enlace Ciudadano Nro. 225 - EmelecEnlace Ciudadano Nro. 225 - Emelec
Enlace Ciudadano Nro. 225 - Emelec
 
[STRUAN TEAGUE] [SAY SOMETHING]
[STRUAN TEAGUE] [SAY SOMETHING][STRUAN TEAGUE] [SAY SOMETHING]
[STRUAN TEAGUE] [SAY SOMETHING]
 
Social Media & Recht – Dr. Martin Schirmbacher, Fachanwalt für IT-Recht
Social Media & Recht – Dr. Martin Schirmbacher, Fachanwalt für IT-RechtSocial Media & Recht – Dr. Martin Schirmbacher, Fachanwalt für IT-Recht
Social Media & Recht – Dr. Martin Schirmbacher, Fachanwalt für IT-Recht
 
Torque QA Webinar Slides
Torque QA Webinar SlidesTorque QA Webinar Slides
Torque QA Webinar Slides
 
eLearning & Moodle
eLearning & MoodleeLearning & Moodle
eLearning & Moodle
 

Kürzlich hochgeladen

Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfsmsksolar
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadhamedmustafa094
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARKOUSTAV SARKAR
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsvanyagupta248
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesRAJNEESHKUMAR341697
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...soginsider
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksMagic Marks
 

Kürzlich hochgeladen (20)

Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdf
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic Marks
 

Java tutorial and advanced training Kerala

  • 2. Class A class depicts a specific sort of article. It can contain related strategies and information individuals (variables). A class must have the same name as the document it is contained in. Eg: public class myClass(){ //data members //constructors //methods }
  • 3. Constructor A special type of instance system that makes another item. In Java, constructors have the same name as their class and have no arrival esteem in their presentation. Eg: public class myClass{ // a constructor that takes no parameters public myClass(){ } // a constructor that takes one parameter public myClass(int var){ } }
  • 4. Declaration An statement that makes a variable, system, or class identifier and its related traits however doesn't fundamentally distribute capacity for variables or characterize an execution for strategies. Class can't be declared and afterward have its body defined somewhere else.
  • 5. Eg1: the variable var is declared int var; Eg 2: the object myObject is declared as an instance of the MyClass class. MyClass myObject; Eg 3: abstract methods, found in abstract classes, can be declared but not defined. public abstract class myAbstractClass(){ // abstract methods are declared. public abstract myMethod() } Eg 4: methods found in interfaces can be declared but not defined. public interface myInterface(){ // methods in an interface are declared public void myMethod(); }
  • 6. Method A collection of code found within a class. If the data members of a class are nouns, the methods are the verbs (the action). Eg 1: a method, myMethod is defined within class myClass that does NOT return a value. public class myClass{ public void myMethod(){ } }
  • 7. Method Eg 2: a method, myMethod is defined within class myClass that returns a boolean. public class myClass{ public boolean myMethod(){ return true; } }
  • 8. Object The principal code building block of Java programs. Each object in a program consists of both variables (data) and methods (functionality). Parameter – a variable or object passed into a method. Eg 1: a method, myMethod is defined which takes 2 parameters. public class MyClass{ public void myMethod(int var1, double var2){ } }
  • 9. Eg 2: myMethod is called. int myInteger = 2; double myDouble = 5.0; myMethod(myInteger, myDouble);
  • 10. Primitive A variable defined with a primitive data type: byte, short, int, long, float, double, char, or boolean. Typecast – (1) to demote a variable from a larger capacity data type to a smaller one. (2) to re-establish the class of an object. The cast associates itself with the expression to its immediate right.
  • 11. Eg 1: A double var is created and then typecast via “(int)” to a variable of integer type ans. double var = 3; int ans = (int) var; Eg 2: All objects extend the Java Object class. // define class MyClass in file MyClass.java public class MyClass{} // in the main method of another class… // instantiate MyClass, but store it in a variable of type Object. Object o = new MyClass(); // typecast object o, back into an instance of MyClass. MyClass myObject = (MyClass) o;
  • 12. Java Training in Kerala Cozak Technologies Ernakulam, Thrissur, Palakkad& Trivandrum E-mail: mail@cozaktechnologies.in Website: www.cozaktechnologies.in Tel: 0491 2553320, 0484 6053320 Mobile: +91 9037 427 420,+91 9037 428 420, +91 9037 429 420 Java projects and Training Kerala| Web developers| Mobile app development,etc