SlideShare a Scribd company logo
1 of 27
OOP-JAVA
Group_2
1
CONTENT
▪ What is OOP
▪ Advantages of OOP
▪ What is JAVA
▪ Where is Java used
▪ Java Program Translation
▪ Java Program Structure
▪ Data Type in Java
▪ Conditional Control Statement
▪ Loop Control Statement
▪ Class, object, method in java
▪ Constructor
2
WHAT IS OOP
▪ OOP stands for Object-Oriented Programming
▪ Procedural programming is about writing procedures or
methods that perform operations on the data, while
object-oriented programming is about creating objects
that contain both data and methods.
3
ADVANTAGES OF OOP
• OOP is faster and easier to execute
• OOP provides a clear structure for the programs
• OOP helps to keep the Java code DRY "Don't Repeat
Yourself", and makes the code easier to maintain, modify
and debug
• OOP makes it possible to create full reusable applications
with less code and shorter development time
4
WHAT IS JAVA
• Java is a programming language and a platform.
• Java is a high level, highly powerful, secure and object oriented
programming language
• Java was developed by a team led by James Gosling at Sun
Microsystems.
• Java is a first programming language which provide the concept of
writing programs that can be executed using the web.
5
WHERE IS JAVA USED
• Mobile applications (specially Android apps)
• Desktop applications
• Web applications
• Web servers and application servers
• Games
• Database connection
• And much, much more!
6
JAVA PROGRAM TRANSLATION
7
Java
Program
Compiler
Java
Bytecode
Program
Java Interpreter
For Mac OS
Java Interpreter
For Windows
Java Interpreter
For Linux
JAVA PROGRAM STRUCTURE
8
Documentation Section(Optional)
Package Statement
Import Statements(Optional)
Class Definition
Inheritance Statements(Optional)
Interface Statements(Optional)
Main method class(Essential)
{
main method definition
}
DATA TYPES IN JAVA
9
Data Types
Primitive Non-Primitive
Numeric Non-Numeric
Integral Type Floating Point Boolean Char
byte int short long float double
Array String Class Interface
Data Types
Primitive Non-Primitive
Numeric
CONDITIONAL CONTROL STATEMENT
▪ Conditional statements define conditions that are true or false and
then execute based on whether or not the condition is true.
Basically, conditions say, “If x is true, then execute y”. This logic is
called an “if-statement”.
▪ There are some conditional statements:
1. If
2. If else
3. Else if
4. Switch
10
IF-ELSE SYNTAX
11
IF-ELSE DEMO(LEAP YEAR)
12
SWITCH SYNTAX
13
switch(expression) {
case x:
// code block
break;
case y:
// code block
break;
Default:
// code block
}
SWITCH DEMO (ACADEMIC YEAR)
14
LOOP CONTROL STATEMENT
▪ With loop control statements, you can repeatedly execute a block of
code.
▪ There are four loop Statements
1. For loop statement
Syntax : for(init; condition; incr/decr){
// code to be executed
}
2. While loop statement
Syntax : while(condition){
//code to be executed
}
3. Do-while statement
Syntax : do{
//code to be executed
} while(condition);
4. Continue
15
FOR LOOP DEMO(FIBONACCI NUMBER)
16
WHILE LOOP DEMO(NUMBER INCREASE)
17
DO-WHILE DEMO(NUMBER INCREASE)
18
CLASS, OBJECT, METHOD IN JAVA
▪ Everything in Java is associated with classes and
objects, along with its attributes and methods. For
example: in real life, a car is an object. The car
has attributes, such as weight and color, and methods,
such as drive and brake.
▪ A Class is like an object constructor, or a "blueprint"
for creating objects.
19
CLASS DECLARATION
▪ Class declaration syntax:
class ClassName
{
Member Variable Declaration;
Member Function
}
20
▪ Example:
class Student //classname
{
int Roll; // Member Variable
String Name; // Member Variable
float Mark; // Member Variable
void GetData() //Member Function
{
//Body of the Method
}
} //End of the Class
OBJECT DECLARATION
▪ Initializing an object means storing data into the object from
class.
▪ Syntax
className objectName = new className();
▪ Example:
Student obj = new Student(); //Student is className and obj is ObjectName
21
METHOD DECLARATION
▪ A method is a block of code which only runs when it is called.
▪ You can pass data, known as parameters, into a method.
▪ Methods are used to perform certain actions, and they are also
known as functions.
▪ Syntax
modifier returnType nameOfMethod (Parameter
List)
{
// method body
}22
CONSTRUCTOR DECLARATION
▪ Constructor looks like a method but it is in fact not a method. It’s
name is same as class name and it does not return any value.
▪ Syntax
class className
{
private members;
protected members;
public className()
{
//Body
}
23
CLASS,OBJECT,METHOD DEMO
24
CONSTRUCTOR DEMO
25
ANY QUERY ?
26
THANK YOU
27

More Related Content

Similar to Oop java Concept

QA / Testing Tools, Automation Testing, Online & Classroom Training
QA / Testing Tools, Automation Testing, Online & Classroom Training QA / Testing Tools, Automation Testing, Online & Classroom Training
QA / Testing Tools, Automation Testing, Online & Classroom Training AnanthReddy38
 
Java Programming Important Topics
Java Programming Important Topics Java Programming Important Topics
Java Programming Important Topics SANJAYMANVATKAR1
 
Session 02 - Elements of Java Language
Session 02 - Elements of Java LanguageSession 02 - Elements of Java Language
Session 02 - Elements of Java LanguagePawanMM
 
Java Programming concept
Java Programming concept Java Programming concept
Java Programming concept Prakash Poudel
 
Java Basics for selenium
Java Basics for seleniumJava Basics for selenium
Java Basics for seleniumapoorvams
 
Basic online java course - Brainsmartlabs
Basic online java course  - BrainsmartlabsBasic online java course  - Brainsmartlabs
Basic online java course - Brainsmartlabsbrainsmartlabsedu
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to javaSujit Majety
 
Java programming language
Java programming languageJava programming language
Java programming languageSubhashKumar329
 
Introduction to oop and java fundamentals
Introduction to oop and java fundamentalsIntroduction to oop and java fundamentals
Introduction to oop and java fundamentalsAnsgarMary
 
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)indiangarg
 
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
 

Similar to Oop java Concept (20)

QA / Testing Tools, Automation Testing, Online & Classroom Training
QA / Testing Tools, Automation Testing, Online & Classroom Training QA / Testing Tools, Automation Testing, Online & Classroom Training
QA / Testing Tools, Automation Testing, Online & Classroom Training
 
Java basic
Java basicJava basic
Java basic
 
Unit 1
Unit 1Unit 1
Unit 1
 
Java Programming Important Topics
Java Programming Important Topics Java Programming Important Topics
Java Programming Important Topics
 
CS8392 OOP
CS8392 OOPCS8392 OOP
CS8392 OOP
 
Core Java Tutorial
Core Java TutorialCore Java Tutorial
Core Java Tutorial
 
oop unit1.pptx
oop unit1.pptxoop unit1.pptx
oop unit1.pptx
 
1.Java_programming2017.pdf
1.Java_programming2017.pdf1.Java_programming2017.pdf
1.Java_programming2017.pdf
 
Session 02 - Elements of Java Language
Session 02 - Elements of Java LanguageSession 02 - Elements of Java Language
Session 02 - Elements of Java Language
 
Java9to19Final.pptx
Java9to19Final.pptxJava9to19Final.pptx
Java9to19Final.pptx
 
Java 9, JShell, and Modularity
Java 9, JShell, and ModularityJava 9, JShell, and Modularity
Java 9, JShell, and Modularity
 
Java Programming concept
Java Programming concept Java Programming concept
Java Programming concept
 
Letest
LetestLetest
Letest
 
Java Basics for selenium
Java Basics for seleniumJava Basics for selenium
Java Basics for selenium
 
Basic online java course - Brainsmartlabs
Basic online java course  - BrainsmartlabsBasic online java course  - Brainsmartlabs
Basic online java course - Brainsmartlabs
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Java programming language
Java programming languageJava programming language
Java programming language
 
Introduction to oop and java fundamentals
Introduction to oop and java fundamentalsIntroduction to oop and java fundamentals
Introduction to oop and java fundamentals
 
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)
 
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
 

Recently uploaded

Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
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 MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 

Recently uploaded (20)

Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 

Oop java Concept

  • 2. CONTENT ▪ What is OOP ▪ Advantages of OOP ▪ What is JAVA ▪ Where is Java used ▪ Java Program Translation ▪ Java Program Structure ▪ Data Type in Java ▪ Conditional Control Statement ▪ Loop Control Statement ▪ Class, object, method in java ▪ Constructor 2
  • 3. WHAT IS OOP ▪ OOP stands for Object-Oriented Programming ▪ Procedural programming is about writing procedures or methods that perform operations on the data, while object-oriented programming is about creating objects that contain both data and methods. 3
  • 4. ADVANTAGES OF OOP • OOP is faster and easier to execute • OOP provides a clear structure for the programs • OOP helps to keep the Java code DRY "Don't Repeat Yourself", and makes the code easier to maintain, modify and debug • OOP makes it possible to create full reusable applications with less code and shorter development time 4
  • 5. WHAT IS JAVA • Java is a programming language and a platform. • Java is a high level, highly powerful, secure and object oriented programming language • Java was developed by a team led by James Gosling at Sun Microsystems. • Java is a first programming language which provide the concept of writing programs that can be executed using the web. 5
  • 6. WHERE IS JAVA USED • Mobile applications (specially Android apps) • Desktop applications • Web applications • Web servers and application servers • Games • Database connection • And much, much more! 6
  • 7. JAVA PROGRAM TRANSLATION 7 Java Program Compiler Java Bytecode Program Java Interpreter For Mac OS Java Interpreter For Windows Java Interpreter For Linux
  • 8. JAVA PROGRAM STRUCTURE 8 Documentation Section(Optional) Package Statement Import Statements(Optional) Class Definition Inheritance Statements(Optional) Interface Statements(Optional) Main method class(Essential) { main method definition }
  • 9. DATA TYPES IN JAVA 9 Data Types Primitive Non-Primitive Numeric Non-Numeric Integral Type Floating Point Boolean Char byte int short long float double Array String Class Interface Data Types Primitive Non-Primitive Numeric
  • 10. CONDITIONAL CONTROL STATEMENT ▪ Conditional statements define conditions that are true or false and then execute based on whether or not the condition is true. Basically, conditions say, “If x is true, then execute y”. This logic is called an “if-statement”. ▪ There are some conditional statements: 1. If 2. If else 3. Else if 4. Switch 10
  • 13. SWITCH SYNTAX 13 switch(expression) { case x: // code block break; case y: // code block break; Default: // code block }
  • 15. LOOP CONTROL STATEMENT ▪ With loop control statements, you can repeatedly execute a block of code. ▪ There are four loop Statements 1. For loop statement Syntax : for(init; condition; incr/decr){ // code to be executed } 2. While loop statement Syntax : while(condition){ //code to be executed } 3. Do-while statement Syntax : do{ //code to be executed } while(condition); 4. Continue 15
  • 17. WHILE LOOP DEMO(NUMBER INCREASE) 17
  • 19. CLASS, OBJECT, METHOD IN JAVA ▪ Everything in Java is associated with classes and objects, along with its attributes and methods. For example: in real life, a car is an object. The car has attributes, such as weight and color, and methods, such as drive and brake. ▪ A Class is like an object constructor, or a "blueprint" for creating objects. 19
  • 20. CLASS DECLARATION ▪ Class declaration syntax: class ClassName { Member Variable Declaration; Member Function } 20 ▪ Example: class Student //classname { int Roll; // Member Variable String Name; // Member Variable float Mark; // Member Variable void GetData() //Member Function { //Body of the Method } } //End of the Class
  • 21. OBJECT DECLARATION ▪ Initializing an object means storing data into the object from class. ▪ Syntax className objectName = new className(); ▪ Example: Student obj = new Student(); //Student is className and obj is ObjectName 21
  • 22. METHOD DECLARATION ▪ A method is a block of code which only runs when it is called. ▪ You can pass data, known as parameters, into a method. ▪ Methods are used to perform certain actions, and they are also known as functions. ▪ Syntax modifier returnType nameOfMethod (Parameter List) { // method body }22
  • 23. CONSTRUCTOR DECLARATION ▪ Constructor looks like a method but it is in fact not a method. It’s name is same as class name and it does not return any value. ▪ Syntax class className { private members; protected members; public className() { //Body } 23

Editor's Notes

  1. শর্তাধীন বিবৃতি শর্তগুলি সংজ্ঞায়িত করে যা সত্য বা মিথ্যা এবং তারপরে শর্তটি সত্য কিনা এর ভিত্তিতে সম্পাদন করে। মূলত শর্তাবলী বলে, "যদি এক্স সত্য হয় তবে y চালিত করুন"। এই যুক্তিটিকে একটি "যদি বিবৃতি" বলা হয়।