← Back to list

Class and Object in Java

Class:

Varshajawale · 2023-10-22 15:53 · 0 claps · 0.9 min read
#class-and-objects-in-java
Open on Medium ↗

Class and Object in Java

Class:

Class is user-defined datatypes. A class contains properties and methods. It is a blueprint and prototype. The class name is always defined with the first letter in upper case. It is organized with a relevant thing. class does not occupy memory. The syntax of the class is

access_modifier class ClassName {

//Properties and Methods

// constructor and nested class

}

Method: A set of codes that perform a particular task. It is used for code reusability.

Syntax: access_modifier return_type method_name( parameter list){

}

Object: An object is an instance of a class. The object is a physical reality of class. It consumes memory. Every object is a unique identifier by hashcode object is created by using the ‘new’ keyword. object is a superclass of objects.

Syntax:

class_Name obj_Name=new class_Name();


메타데이터
post_id
ea8dc5f1ace4
slug
class-and-object-in-java-ea8dc5f1ace4
url
https://medium.com/@varshajawale23/class-and-object-in-java-ea8dc5f1ace4
canonical_url
https://medium.com/@varshajawale23/class-and-object-in-java-ea8dc5f1ace4
author_url
https://medium.com/@varshajawale23
status
ok
fetched_at
2026-08-30 03:23:26