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
34 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,160 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
1 answer

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

Please check the below code to arrive ...READ MORE

answered Nov 21, 2018 in Java by Frankie
• 9,810 points
65 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
203 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
39 views
0 votes
1 answer

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

String lString = String.join(", ", list); In case ...READ MORE

answered Apr 26, 2018 in Java by developer_1
• 3,280 points
38 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 6,190 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,050 points
1,630 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,050 points
4,331 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,050 points
335 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,160 points
40 views
0 votes
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,160 points
1,421 views