Class A extends Class B but Class A also inherit Super Class
Object so it is multiple inheritence give reason in support of
your answer
Answers were Sorted based on User's Feedback
Answer / srinivas
class A extends class B so that class A points the object
of object class through class B object. there fore it will
be called as maltilevel inheritence but not multipul
inheritence.
Is This Answer Correct ? | 10 Yes | 2 No |
Answer / sandhya reddy
For every class, Object class is the super class.
class A extends class B and at the same time class A is sub
class of object class and super class of class B. But class
B is only sub class of Class A. SO here MultiLevel
Inheritance is happening not multiple inheritance happen.
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / skpttanayak
How come classs A be super class of class B dear...Class b
is not the subclass here...but superclass.
Is This Answer Correct ? | 0 Yes | 0 No |
What are the main differences between the java platform and other platforms?
What is autoboxing and unboxing?
Can we create an object if a class doesn't have any constructor ( not even the default provided by constructor ) ?
Explain parallel processing in java8?
what is the purpose of "virtual"?
Explain the difference between getAppletInfo and getParameterInfo?
public class AboutStrings{ public static void main(String args[]){ String s1="hello"; String s2="hel"; String s3="lo"; String s4=s2+s3; //to know the hash codes of s1,s4. System.out.println(s1.hashCode()); System.out.println(s4.hashCode()); // these two s1 and s4 are having same hashcodes. if(s1==s4){ System.out.println("s1 and s4 are same."); }else System.out.println("s1 and s4 are not same."); } } Somebody told me that, == operator compares references of the objects. In the above example even though s1 and s4 are refering to same object(having same hash codes), it is printing s1 and s4 are not same. Can anybody explain in detail why it is behaving like this? Thanks in Advance RavuriVinod
How to excute - Interface - Inner class- method can any one tell how to execute/ call this main method public interface abc { static int i=0; void dd(); class a1 { a1() { int j; System.out.println("inside"); }; public static void main(String a1[]) { System.out.println("in interfia"); } } }
What is port number in java?
What is tostring () method?
What is method overloading in java ?
Is map sorted in java?