true

Find the best tutors and institutes for Java Training

Find Best Java Training Classes

Please select a Category.

Please select a Locality.

No matching category found.

No matching Locality found.

Outside India?

Search for topics

JAVA - Object Class & it’s methods

Gaurav Kothari
08 Sep 0 2

JAVA - Object Class & it’s methods : 

Object class is the top class in java. It means every single class internally extends Object class. It is a parent class of all other classes in java.

We can store any type of object in reference of object class. For example:

Object obj = new Emp(); // Here obj holds Emp

Object class has 11 methods in it. You can see these methods in source code of object class.

  • hashCode() - returns the hashcode number for this object. It returns distinct integers for distinct objects.
  • equals(Object obj) - compares the given object to this object.
  • clone() - throws CloneNotSupportedException creates and returns the exact copy (clone) of this object.
  • toString() - returns the string representation of this object.
  • finalize() - is invoked by the garbage collector before object is being garbage collected.
  • getClass() - returns the class object of “this” object or returns the Class class object of this object

For ex: Object obj = new String("Test");

            Class c = obj.getClass();

            System.out.println("Class of Object obj is : " + c.getName());

  • notify() - wakes up a thread that is in waiting state.
  • notifyAll() - wakes up all the threads that is in waiting state.
  • wait() - throws InterruptedException, makes current thread to wait, until another thread notifies (invokes notify() or notifyAll() method).
  • wait(long timeout) – parameterize wait
  • wait(long timeout,int nanos) – parameterize wait

 

Please add on comments and like this lesson, if it gave you some revision or refreshment on “JAVA - Object Class & it’s methods”.

0 Dislike
Follow 2

Please Enter a comment

Submit

P

Pinaki Prasad rath | 17 Oct

How can we define an object?

0 0
P

Pinaki Prasad rath | 17 Oct

What is the method?

0 0

Other Lessons for You

Product Owner in Agile
- Define the overall UX strategy and vision for the user experiences across all of the external and internal platform, aligning with the Senior Leadership Team.- Working closely with the business team...

Dannie Joe A | 11 Sep

0 0
0

Write your first Python program in 10 minutes
1. Download python from python official site search "python download" in google 2. Install in your machine 3. verify using : "python --version" command 4. Write first program using notepad create...

Debrati Sadhu | 04 Aug

1 0
0

Overloading in JAVA
When a class contains more than one method with the same method name but different argument types, then it is called Overloading. Methods are said to be Overloaded methods. Also, know as Compile time...

Swati S. | 19 May

0 0
0

Compiling C program on Linux machine GCC ,GDB
Linux have powerful tool called "Terminal". From "terminal" we can command the machine. For any programming language the required tools are editor, compiler and debugger. Compiler will check the syntax...

Narasimha Reddy | 06 Mar

0 0
0

Migration from other languages to Salesforce
Anyone can easily migrate from other language to Salesforce. People must have skills to understand business logic.
X

Looking for Java Training Classes?

Find best tutors for Java Training Classes by posting a requirement.

  • Post a learning requirement
  • Get customized responses
  • Compare and select the best

Looking for Java Training Classes?

Find best Java Training Classes in your locality on UrbanPro

Post your learning requirement

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 25 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 6.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more