ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
write a simple program inheritance?
 Question Submitted By :: Gopalraop
I also faced this Question!!     Rank Answer Posted By  
 
  Re: write a simple program inheritance?
Answer
# 1
class A
{

}
class B extends A
{
        public static void main(String args[])
        {
            B b = new B();
         
        } 
}
In the above example, B is the class extending the A class.
Means that B is inherited from A.
 
Is This Answer Correct ?    6 Yes 0 No
Prashant Khot
 
  Re: write a simple program inheritance?
Answer
# 2
class A
{
   int a=10;
}
class B extend A
{
 public static void main(String[] a)
  {
     B objB;
     objB=new A();
     System.out.println("Value of a is"+objB.a);
  }
}
 
Is This Answer Correct ?    0 Yes 0 No
Dhawal
 
 
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
what is request processor? Virtusa1
What is the diff. b/w Interfaces & Abstract class? Ericsson4
What are Access Specifiers and Access Modifiers. TCS4
how many ways to create Thread and which one is good? runnable interface ot Thread class? Satyam3
Can a Byte object be cast to a double value?  2
What classes can be used to store arbitrary number of objects ?  1
When try and catch block is used ?  6
what is difference between perfom() & excute() ? IBM2
What is singleton class?  6
Nullpointer exception is a very common exception. Why is it not made as a checked exception? Ness-Technologies1
what is difference between String buffer and String builder? Benchmark2
Can we place the any object to key attribute of HashMap<key,value>? HCL3
explain System.out.println() CTS7
What class is used to implement a Throwable array?  3
Why Wait and notify are kept in Object class although they are used only with Thread Class Saksoft2
What is the USE of Null interfaces ??...if thers nothing inside these interfaces how are they used and WHy are they used ???? No 1 has given a proper description yet  1
How can a class be accessed, If no access modifiers are declared?  2
What is meant by final class, methods and variables?  2
What do you mean by the term transient? Ericsson4
Can we access a database using applets?  2
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com