I know by inheritance all classes inherit methods from Object class.Similarly if we extends one class with other it also inherit method. Then why we can call inherited protected method from other class and not able to call inheritate method from Object class
package com.core.test;
public class CloneableTest {
public static void main(String[] args) {
Testclass test= new Testclass();
test.someClassSpecificMethod();
test.clone(); //ERROR AT tHIS LINE why
}
}
class SomeClass implements Cloneable {
protected void someClassSpecificMethod(){
}
}
class Testclass extends SomeClass {
}
In above file As I can able to access someClassSpecificMethod using instance of Testclass then why I cannot able to access clone method?