What is an Object?

+1 vote

An instance of a class is called object. The object has state and behavior.

Whenever the JVM reads the “new()” keyword then it will create an instance of that class.

Dec 24, 2018 in Java by preetiagarwal
• 170 points
50 views
So what is the confusion here @Preeti?

2 answers to this question.

+1 vote
Hey @preetiagarwal, your description is an answer on its own.

Defining it in a more elaborate way.

Obejct is a combination of data and procedures that works on your data. It has both state and behaviour.

The state of an object is stored in variables while functions display the object's behaviour.

Object are created from templates known as Class created by the help of "new" keyword.

Hope this definition helps.
answered Dec 24, 2018 by Priyaj
• 56,940 points
0 votes
Think about it this way.

Animal is a Class.

Cat, Dog, Lion, Tiger are sub-class.

German Shepherd, Rottweiler, Bull Dog are Objects of Class Dog.

Hope you got this example @preetiagarwal.
answered Dec 24, 2018 by andrew

Related Questions In Java

0 votes
2 answers

In Java, what is the best way to determine the size of an object?

I happened to find a java class "jdk.nashorn.internal.ir.debug.ObjectSizeCalculator", ...READ MORE

answered Aug 19 in Java by Sirajul
• 38,420 points
184 views
+1 vote
3 answers

What is the syntax to declare and initialize an array in java?

You can use this method: String[] strs = ...READ MORE

answered Jul 25, 2018 in Java by samarth295
• 2,190 points
597 views
0 votes
2 answers

What is the syntax to initialize an array?

Rather than learning un-Official websites learn from ...READ MORE

answered Aug 2, 2018 in Java by samarth295
• 2,190 points
61 views
0 votes
2 answers

what is the best way to convert an ArrayList to a String

You could probably use the Joiner class ...READ MORE

answered Aug 19 in Java by Sirajul
• 38,420 points
77 views
+5 votes
3 answers

How to execute a python file with few arguments in java?

You can use Java Runtime.exec() to run python script, ...READ MORE

answered Mar 27, 2018 in Java by DragonLord999
• 8,380 points

edited Nov 6, 2018 by Omkar 10,347 views
0 votes
1 answer

How to handle drop downs using Selenium WebDriver in Java

First, find an XPath which will return ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,110 points
2,294 views
0 votes
1 answer

What are the differences between getText() and getAttribute() functions in Selenium WebDriver?

See, both are used to retrieve something ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,110 points
5,987 views
0 votes
1 answer

Selenium JARS(Java) missing from downloadable link

Nothing to worry about here. In the ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,110 points
710 views
0 votes
1 answer

What is an Operand Stack in Java?

The basic utility of Operand Stack are ...READ MORE

answered Mar 7 in Java by Priyaj
• 56,940 points
108 views
+1 vote
4 answers

What is difference between access modifier and access specifier in java

Access Specifier:- This can be understood as ...READ MORE

answered Feb 14 in Java by Priyaj
• 56,940 points
6,163 views