google.com, pub-8786015629279405, DIRECT, f08c47fec0942fa0 Introducing Classes in Java

Introducing Classes in Java

0

Class: A Class is a implementation model where we implement the properties method and other things which is access by the object of class. In other words, A class 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. In general, class declarations can include these components, in order: 

Syntax of a Class:

modifier (if_any) class class_name

{

Body of a class;

<<it have methods, fields and properties of the class>>

}




Modifiers: A class can be public or has default access (Refer this for details).

class keyword: class keyword is used to create a class.

Class name: The name should begin with an initial letter (capitalized by convention).

Superclass(if any): The name of the class’s parent (superclass), if any, preceded by the keyword extends. A class can only extend (subclass) one parent.

Interfaces(if any): 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, { }.

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Thank you for your interest 😊

We will back shortly after reviewing...

Thank you for your interest 😊

We will back shortly after reviewing...

Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !
To Top