SlideShare a Scribd company logo
1 of 7
CLASSES AND
OBJECT
A.Sangeetha M.Sc(info Tech)
Department Of Cs&it
Nadar Saraswathi College Of Arts And Science
INTRODECTION:
 Java is a true OO language and therefore the underlying
structure of all Java programs is classes.
 „Anything we wish to represent in Java must be encapsulated in
a class that defines the “state "and “behaviour”of
the basic program components known as objects.
 „C lasses create objects and objects use methods to
communicate between them.
CLASS:
A class is a collection of fields (data) and
method (procedure or function) that
operate on that data
child
Centre
radius
Circumference()
Radius()
A classes is a collection of
fields(data)and methods (procedure
or function)that operate on that
data.
class Cl a s s N a m e
[extends
Su p e r Cl a s s N a m e ]
{
[fields declaration]
[methods declaration]
}
Bare bone class-no fields,no method.
A class with only data fields has no life.
Objects created by such a class cannot
respond to any messages.
public class Circle {
// my circle class
}
Methods are declared inside the body of the
class but immediately after the declaration of
data fields.
„The general form of a method declaration is:
type Method
Name(parameter-list)
{
Method-body;
 Objects are created dynamically using the

More Related Content

What's hot (17)

Lecture 10
Lecture 10Lecture 10
Lecture 10
 
More oop in java
More oop in javaMore oop in java
More oop in java
 
Java basic-syntax
Java basic-syntaxJava basic-syntax
Java basic-syntax
 
object oriented programming using c++
 object oriented programming using c++ object oriented programming using c++
object oriented programming using c++
 
Inner class
Inner classInner class
Inner class
 
Java basic-syntax
Java basic-syntaxJava basic-syntax
Java basic-syntax
 
Java basic syntax
Java basic syntaxJava basic syntax
Java basic syntax
 
[OOP - Lec 06] Classes and Objects
[OOP - Lec 06] Classes and Objects[OOP - Lec 06] Classes and Objects
[OOP - Lec 06] Classes and Objects
 
c++ lecture 1
c++ lecture 1c++ lecture 1
c++ lecture 1
 
Chapter 6.4
Chapter 6.4Chapter 6.4
Chapter 6.4
 
QSpiders - Major difference
QSpiders - Major differenceQSpiders - Major difference
QSpiders - Major difference
 
Class properties
Class propertiesClass properties
Class properties
 
Ifi7184 lesson5
Ifi7184 lesson5Ifi7184 lesson5
Ifi7184 lesson5
 
Aman kingrubyoo pnew
Aman kingrubyoo pnew Aman kingrubyoo pnew
Aman kingrubyoo pnew
 
Java Basic
Java Basic Java Basic
Java Basic
 
Implementing polymorphism
Implementing polymorphismImplementing polymorphism
Implementing polymorphism
 
Python - object oriented
Python - object orientedPython - object oriented
Python - object oriented
 

Similar to Java (20)

Java sem i
Java sem iJava sem i
Java sem i
 
Lecture 2 classes i
Lecture 2 classes iLecture 2 classes i
Lecture 2 classes i
 
Abstract class and interface
Abstract class and interfaceAbstract class and interface
Abstract class and interface
 
Class Diagram
Class DiagramClass Diagram
Class Diagram
 
Lect 1-class and object
Lect 1-class and objectLect 1-class and object
Lect 1-class and object
 
Classes objects in java
Classes objects in javaClasses objects in java
Classes objects in java
 
Class and Object.ppt
Class and Object.pptClass and Object.ppt
Class and Object.ppt
 
OO Development 4 - Object Concepts
OO Development 4 - Object ConceptsOO Development 4 - Object Concepts
OO Development 4 - Object Concepts
 
classandobjectunit2-150824133722-lva1-app6891.ppt
classandobjectunit2-150824133722-lva1-app6891.pptclassandobjectunit2-150824133722-lva1-app6891.ppt
classandobjectunit2-150824133722-lva1-app6891.ppt
 
Oop
OopOop
Oop
 
C++ And Object in lecture3
C++  And Object in lecture3C++  And Object in lecture3
C++ And Object in lecture3
 
4. Classes and Methods
4. Classes and Methods4. Classes and Methods
4. Classes and Methods
 
C# program structure
C# program structureC# program structure
C# program structure
 
Object Oriented Programming using JAVA Notes
Object Oriented Programming using JAVA Notes Object Oriented Programming using JAVA Notes
Object Oriented Programming using JAVA Notes
 
Object Oriented Programming_Lecture 2
Object Oriented Programming_Lecture 2Object Oriented Programming_Lecture 2
Object Oriented Programming_Lecture 2
 
Oops
OopsOops
Oops
 
4 Classes & Objects
4 Classes & Objects4 Classes & Objects
4 Classes & Objects
 
Ppt chapter05
Ppt chapter05Ppt chapter05
Ppt chapter05
 
Oops
OopsOops
Oops
 
javaopps concepts
javaopps conceptsjavaopps concepts
javaopps concepts
 

More from SangeethaSasi1 (20)

L4 multiplexing & multiple access 16
L4 multiplexing & multiple access 16L4 multiplexing & multiple access 16
L4 multiplexing & multiple access 16
 
Image processing using matlab
Image processing using matlab Image processing using matlab
Image processing using matlab
 
Mc ppt
Mc pptMc ppt
Mc ppt
 
Mc ppt
Mc pptMc ppt
Mc ppt
 
Dip pppt
Dip ppptDip pppt
Dip pppt
 
Web techh
Web techhWeb techh
Web techh
 
Web tech
Web techWeb tech
Web tech
 
Vani wt
Vani wtVani wt
Vani wt
 
Vani dbms
Vani dbmsVani dbms
Vani dbms
 
Hema wt (1)
Hema wt (1)Hema wt (1)
Hema wt (1)
 
Hema rdbms
Hema rdbmsHema rdbms
Hema rdbms
 
Web tech
Web techWeb tech
Web tech
 
Web tech
Web techWeb tech
Web tech
 
Dbms
DbmsDbms
Dbms
 
Vani
VaniVani
Vani
 
Hema se
Hema seHema se
Hema se
 
Software
SoftwareSoftware
Software
 
Operating system
Operating systemOperating system
Operating system
 
Dataminng
DataminngDataminng
Dataminng
 
System calls
System callsSystem calls
System calls
 

Recently uploaded

ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 

Recently uploaded (20)

ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 

Java

  • 1. CLASSES AND OBJECT A.Sangeetha M.Sc(info Tech) Department Of Cs&it Nadar Saraswathi College Of Arts And Science
  • 2. INTRODECTION:  Java is a true OO language and therefore the underlying structure of all Java programs is classes.  „Anything we wish to represent in Java must be encapsulated in a class that defines the “state "and “behaviour”of the basic program components known as objects.  „C lasses create objects and objects use methods to communicate between them.
  • 3. CLASS: A class is a collection of fields (data) and method (procedure or function) that operate on that data child Centre radius Circumference() Radius()
  • 4. A classes is a collection of fields(data)and methods (procedure or function)that operate on that data. class Cl a s s N a m e [extends Su p e r Cl a s s N a m e ] { [fields declaration] [methods declaration] }
  • 5. Bare bone class-no fields,no method. A class with only data fields has no life. Objects created by such a class cannot respond to any messages. public class Circle { // my circle class }
  • 6. Methods are declared inside the body of the class but immediately after the declaration of data fields. „The general form of a method declaration is: type Method Name(parameter-list) { Method-body;
  • 7.  Objects are created dynamically using the