they asked class A{}
class B{}
class c{}
all the three class saved as a single file,there is no main
method in the file
and anothe class
M.java
class m
{
psvm(String args[])
{
// here the parent class can access
}
}

Answers were Sorted based on User's Feedback



they asked class A{} class B{} class c{} all the three class saved as a single file,there is no m..

Answer / suresh

Yes. You can call parent classes ( i.e A or B or C) inside
of class M by instantiate and invoke methods. If parent
classes have static methods you can directly access without
instantiating.

Is This Answer Correct ?    1 Yes 0 No

they asked class A{} class B{} class c{} all the three class saved as a single file,there is no m..

Answer / cool_duzz

What is the Question? Please explain...

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Core Java Interview Questions

What is replaceall in java?

0 Answers  


Why are constructors used?

0 Answers  


adapter class ?

2 Answers  


What is the covariant return type?

0 Answers  


Explain the importance of finally block in java?

0 Answers  


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

4 Answers   TCS,


wat is final...? wat is finally...? wat is finalize....? difference between " final and finally and finalize "...?

2 Answers  


Give some features of interface?

0 Answers  


Why do we create public static method in java?

0 Answers  


How infinite loop is declared?

0 Answers  


What is final modifier?

0 Answers  


What is meant by javabeans?

0 Answers  


Categories