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   SiteMap shows list of All Categories in this site.
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
In Inheritence concept, i have a static method in super 
class and i am inheriting that class to one sub class.in 
that case the static method is inherited to sub class or 
not????
 Question Submitted By :: Karun_cts
I also faced this Question!!     Rank Answer Posted By  
 
  Re: In Inheritence concept, i have a static method in super class and i am inheriting that class to one sub class.in that case the static method is inherited to sub class or not????
Answer
# 1
As per my knowledge static method can't be subclass and 
override.
 
Is This Answer Correct ?    4 Yes 1 No
Eswar
 
  Re: In Inheritence concept, i have a static method in super class and i am inheriting that class to one sub class.in that case the static method is inherited to sub class or not????
Answer
# 2
As per my knowledge static method can not  be inhertated , 
but we use the same concept provideing that method hidding 
concept.i.e we should not override the super class static 
method in subclass.we just declare  in subclass under 
hidding concept.
 
Is This Answer Correct ?    0 Yes 1 No
Ramana
 
 
 
  Re: In Inheritence concept, i have a static method in super class and i am inheriting that class to one sub class.in that case the static method is inherited to sub class or not????
Answer
# 3
the static method will be inherited to teh sub class.only 
fucntions declared as 'final' are not inherited
 
Is This Answer Correct ?    1 Yes 1 No
Sunitha
 
  Re: In Inheritence concept, i have a static method in super class and i am inheriting that class to one sub class.in that case the static method is inherited to sub class or not????
Answer
# 4
Hi,static methods are methods are inherited.
example
class A {
static void methA() {
System.out.println("inside methA");
}
}
class B extends A {
public static void main(String[] args){
B.methA();
}
}
output:inside methA
 
Is This Answer Correct ?    6 Yes 1 No
Venkat.kanneganti
 
  Re: In Inheritence concept, i have a static method in super class and i am inheriting that class to one sub class.in that case the static method is inherited to sub class or not????
Answer
# 5
The static method is may inherite in the sub class.
 
Is This Answer Correct ?    0 Yes 0 No
Muthu Pandi
 
  Re: In Inheritence concept, i have a static method in super class and i am inheriting that class to one sub class.in that case the static method is inherited to sub class or not????
Answer
# 6
Definitely the  sub class inherits the static method in
super class.
 
Is This Answer Correct ?    0 Yes 0 No
Shivaprasad
 
  Re: In Inheritence concept, i have a static method in super class and i am inheriting that class to one sub class.in that case the static method is inherited to sub class or not????
Answer
# 7
Yes static method in the super class is inherited in the sub
class. See the example:

class Superclass
{
	static  int id;

	Superclass()
	{
		id = 1;
	}

	public void show()
	{
		System.out.println("This is a non static method");
	}

	public static void value()
	{
		System.out.println("Super class static method");
	}
}

class Subclass extends Superclass
{	
	
}
public class Example
{
    	public static void main(String[] args) 
	{
	    	Subclass sub = new Subclass();
		System.out.println(Superclass.id);
		Superclass.value();
		System.out.println(Subclass.id);
		Subclass.value();
	}
}
 
Is This Answer Correct ?    3 Yes 0 No
Chitij Mehrotra
 
  Re: In Inheritence concept, i have a static method in super class and i am inheriting that class to one sub class.in that case the static method is inherited to sub class or not????
Answer
# 8
first understand meaning of static keyword,when we use
static keyword before any data type or before method then
single copy of that method or variale crated in memory,and
use that copy for only that particular class,means as far my
knowledge we can not use static method in subclass.
 
Is This Answer Correct ?    2 Yes 0 No
Dhawal
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
What is meant by packages?  2
java can provide security ,how can provide? IBM3
What are the common problems you have faced while implementing Java?  1
What do you mean by Remote procedure call?  2
Relationship between an event-listener interface and an event-adapter class?  1
List interface?  2
What is the smallest package in Java API?  4
why Runnable interface is preferable than extending the Thread class? Wipro5
What happens when you assigned a 'double' value to a 'String'?  6
Difference between ?System.out.println? and ?System.error.println?? Sai-Softech2
Difference between Superclass and Subclass?  2
Can u overload main()method.Give with example. IBM2
What is the default initialized value of String type variable?  3
what is use of session tracking ?with example? Photon1
What is I/O Filter? TCS1
Explain the difference between getAppletInfo and getParameterInfo?  1
What is the range of the char type?  2
what is the difference between HashMap and Hashtable Value-Labs8
Does java support multi dimensional arrays ?  4
In Inheritence concept, i have a static method in super class and i am inheriting that class to one sub class.in that case the static method is inherited to sub class or not???? Accenture8
 
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