Logo

dev-resources.site

for different kinds of informations.

Day 6 - Object & Class

Published at
1/1/2025
Categories
java
class
object
beginners
Author
vimala_jeyakumar_de64a9b2
Categories
4 categories in total
java
open
class
open
object
open
beginners
open
Author
25 person written this
vimala_jeyakumar_de64a9b2
open
Day 6 - Object & Class

Ojects and Class:

Object:
-> Java is an object-oriented programming language. The core concept of the object-oriented approach is to break complex problems into smaller objects.

-> An object is a real-word entity that has state and behaviour. In other words, an object is a tangible thing that can be touch and feel, like a car or chair, etc. are the example of objects.

-> The banking system is an example of an intangible object. Every object has a distinct identity, which is usually implemented by a unique ID that the JVM uses internally for identification.

Characteristics of an Object:

State: It represents the data (value) of an object.
Behavior: It represents the behavior (functionality) of an object such as deposit, withdraw, etc.
Identity: An object's identity is typically implemented via a unique ID. The ID's value is not visible to the external user; however, it is used internally by the JVM to identify each object uniquely.

Object Definitions:

  • An object is a real-world entity.
  • An object is a runtime entity.
  • The object is an entity which has state and behavior.
  • The object is an instance of a class.

["An object is an instance of a class. A class is a template or blueprint from which objects are created. So, an object is the instance(result) of a class."]

What is a Class in Java?
-> A class is a group of objects which have common properties. It is a template or blueprint from which objects are created. It is a logical entity. It can't be physical.

A class in Java can contain:

Image description

1. Fields

Variables stated inside a class that indicate the status of objects formed from that class are called fields, sometimes referred to as instance variables.
-> They specify the data that will be stored in each class object. Different access modifiers, such as public, private, and protected, can be applied to fields to regulate their visibility and usability.

2. Methods:

Methods are functions defined inside a class that includes the actions or behaviors that objects of that class are capable of performing.
-> These techniques allow the outside world to function and change the object's state (fields). Additionally, methods can be void (that is, they return nothing) or have different access modifiers. They can also return values.

Note:

["without class we cannot create object but the reverse is not true.without object we can create class "]

Reference:
-- https://www.javatpoint.com/object-and-class-in-java
-- https://www.programiz.com/java-programming/class-objects

class Article's
30 articles in total
Favicon
Day3 Class and object in java:
Favicon
Day2 java program
Favicon
Day 6 - Object & Class
Favicon
Unflatten in PyTorch
Favicon
Day 4 java class
Favicon
Get 10th Class Math Notes (Matric Part 2) – Download Now for Free
Favicon
Day 18 - Object Oriented Programming
Favicon
Flatten in PyTorch
Favicon
Elevate Learning with Our E-Class: The Ultimate Student Performance Tracking Software
Favicon
Elevate Learning with Class Connect Pro: The Ultimate Student Performance Tracking Software
Favicon
ExtendableError usage in changesets errors package
Favicon
WordPress Training In Hyderabad
Favicon
Understanding the Distinction Between Class and Object in Object-Oriented Programming
Favicon
OOP concepts are importants
Favicon
Class : Inheritanceβœ… | Struct : Inheritance ❌
Favicon
One JS Class to speak them all
Favicon
Classes in C# | Uzbek
Favicon
Javascript classes explanation in a simple way
Favicon
Unveiling the Power of the :empty() CSS Pseudo-Class
Favicon
Mastering the :not() CSS Pseudo-Class
Favicon
Exploring the :has() CSS Pseudo-Class
Favicon
Unveiling the Java Superhero: The Mysterious Object Class
Favicon
How to use functions in react class components?
Favicon
Safeguarding the Seas: The Strategic Importance of Virginia-Class Submarines
Favicon
Mastering Metaclasses in Python using real-life scenarios
Favicon
TypeScript: Namespace VS Class
Favicon
Understanding Object-Oriented Programming: Unveiling the Power of Classes
Favicon
Learning Python classes
Favicon
Java Polymorphism Best Practices: Writing Clean and Extensible Code
Favicon
This Is How I Prepare The Very Best Regularization / Classification Images Dataset For Stable Diffusion

Featured ones: