What are the public methods of the class Object List all of

What are the public methods of the class Object? List all of them.

Explain what casting means when applied to reference variables and when it must be used.

Explain what the operator instanceof does.

What advantages does an abstract class offer? i.e., why would you create one?

What is the effect of declaring a method as final? of declaring a class as final? A variable? A parameter? 14) What is the difference between private and protected? Be specific in terms of inheritance.

What is the difference between private and protected?Be specific in terms of inheritance.

Solution

1.
- final Class getClass()
- int hashCode()
- boolean equals(Object obj)
- String toString()
- final void notify()
- final void notifyAll()
- final void wait(long timeout)throws InterruptedException
- public final void wait(long timeout,int nanos)throws InterruptedException
- public final void wait()throws InterruptedException


2.
When an object of one class is to be used as an object of other class, thenm it needs to be casted to that class.


3.instanceof operator is used to check whether an object is an instance of a class/interface(given as a parameter) or not.


4.
My declaring a class as abstract class, we don\'t need to define the method in that class. We can define the method individually in its subclasses.

What are the public methods of the class Object? List all of them. Explain what casting means when applied to reference variables and when it must be used. Expl

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site