0% found this document useful (0 votes)
319 views10 pages

Java PPT-1

The document discusses classes in Java. It defines a class as a template that is used to create objects and define object data types and methods. A class determines how an object will behave and what it will contain. There are different types of classes including modifiers, class name, superclass, interfaces, and body. A class is a blueprint while an object is an instance of a class. The document also discusses how to declare a class and the two types of classes - abstract and non-abstract.

Uploaded by

Kathiravan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
319 views10 pages

Java PPT-1

The document discusses classes in Java. It defines a class as a template that is used to create objects and define object data types and methods. A class determines how an object will behave and what it will contain. There are different types of classes including modifiers, class name, superclass, interfaces, and body. A class is a blueprint while an object is an instance of a class. The document also discusses how to declare a class and the two types of classes - abstract and non-abstract.

Uploaded by

Kathiravan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

CLASSES

KM NITHYA
II M.COM (FCA)
18COMB21
MEANING
 A class, in the context of Java, are templates that are used to
create objects, and to define object data types and methods.
Core properties include the data types and methods that may be
used by the object. All class objects should have the
basic class properties.
 A class is an entity that determines how an object will behave
and what the object will contain. In other words, it is a blueprint
or a set of instruction to build a specific type of object.
What is Class

 A class is an entity that


determines how an object
will behave and what the
object will contain. It is a
user defined blueprint or
prototype from which
objects are created.  It
represents the set of
properties or methods that
are common to all objects of
one type.
TYPES OF CLASSES

 Modifiers
 Class name
 Superclass
 Interfaces
 Body
 Modifiers : A class can be public or has default access

 Class name : The name should begin with a initial letter

 Superclass : The name of the class’s parent (superclass), if

any, preceded by the keyword extends. A class can only

extend (subclass) one parent.

 Interfaces :  A comma-separated list of interfaces

implemented by the class, if any, preceded by the keyword

implements. A class can implement more than one interface.

 Body: The class body surrounded by braces, { }.


What is the Difference Between Object & Class

 A class is a blueprint or prototype that defines


the variables and the methods (functions)
common to all objects of a certain kind.
 An object is a specimen of a class. Software
objects are often used to model real-world
objects you find in everyday life.
CLASSES vs OBJECTS
 In Java, objects are containers like data structure
which have state and behavior. Objects
represent the actors in the system or the
application.
 For example, in an HR application, actors are
employee, manager, department or reports. An
object is an instance of a class.
How to declare a Class

 A class declaration may have zero or more


modifiers.
 The keyword class is used to declare a class.
 The <<class name>> is a user-defined name of
the class, which should be a valid identifier.
 Each class has a body, which is specified inside a
pair of braces ({ … }).
 The body of a class contains its different
components, for example, fields, methods, etc.
Types of classes
In Java, you can have two types of class.
 Abstract class – These classes are abstract.
These are incomplete classes. It means you
cannot create an instance of this class. You can
only extend these classes to complete their
specification.

 Non-abstract class – These classes define their


full state and behavior. They are complete
classes. You can create objects of this class.
THANK YOU…

You might also like