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                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
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 ?    2 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 ?    0 Yes 0 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 ?    2 Yes 0 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 ?    1 Yes 0 No
Chitij Mehrotra
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
What is emant by API? is it related to java only or it is common for all OOPS supporting language?  2
Does garbage collection guarantee that a program will not run out of memory?  1
class A{ class B{ } } in which name u save the file,its the program compile? HCL4
What is the % operator?  2
Difference between the String and StringBuffer classes?  2
what is struts-config-xml?and its use?  3
how many design pattern r there? and wht design pattern u use and why ? HP4
Name the types of mouse event listeners ?  2
How you can create a radio buttion using Checkbox class?  1
What is the minimum and maximum length of an identifier? TCS6
Relationship between an event-listener interface and an event-adapter class?  1
What we have to do, when we don't want to implement all methods of an interface?  2
What is an enumeration class?  2
when we write class.forName("any one class"); what happens actually?what it will return?explain stepwise?  3
why abstract class will have a constructor?  2
how to call One constructor from another; Innodata-Isogen4
Name the class that used to read objects directly from a stream? Wipro2
What are the standards to place package statement within a source code file?  1
explain me with a code snippet about the generation and handling of null point exceptions.  1
explain System.out.println IBM18
 
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