Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


can we create object for static class in java

Answers were Sorted based on User's Feedback



can we create object for static class in java..

Answer / soma414@gmail.com

yes we want create the object by using static class in java

Is This Answer Correct ?    0 Yes 0 No

can we create object for static class in java..

Answer / manjula

yes we can able to create object for the static class.. but
it is none of use.. because we can call the static class
without creating the object

Is This Answer Correct ?    0 Yes 0 No

can we create object for static class in java..

Answer / faisal

Yes you can instantiate a static inner class and it makes sense. Internal working of hash map and hash table is based on same

Is This Answer Correct ?    0 Yes 0 No

can we create object for static class in java..

Answer / santosh vyavhare

We can create a object of "static nested class ".
For eg. class Abc{
static class X{
void m()
System.out.println("static nested class method");
}
public static void main(String[] a)
{
X x=new X();
x.m();
}
}


but if you can not declare outer class as a static if u try to make outer class as static it will generate compile time error.
For eg static class X{}
It will generate compile time error as "Illegal modifier for the class".

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

what is the difference between System.exit() and System.exit(1)?

1 Answers   eClinical Solutions, eClinical Works, eClinicalWorks,


What is the diff. b/w Interfaces & Abstract class?

6 Answers   Ericsson,


What do you understand by final value?

0 Answers  


What is parameter tag and what is its use?

1 Answers  


What is the nested interface?

0 Answers  


Explain java thread life cycle.

0 Answers  


How does abstract modifier work?

1 Answers   Wipro,


If I will write String s=new String("XYZ"); String s1=new String("XYZ"); if(s.equals(s1)){ sop("True"); } else{ sop("False"); } This program will give me "True". But When I am creating my own class suppose class Employee{ public Employee(String name); } Employee e= new Employee("XYZ"); Employee e1 = neew Employee("XYZ"); if(e.equals(e1)){ sop("True"); } else{ sop("False"); } Then it will give the output as "False". Can I know what is happening internally?

5 Answers  


while creating thread why we extend thread class

2 Answers  


Define an applet in java?

0 Answers  


heavy components means what?

4 Answers  


In C we use only compiler. Why java uses both compiler and interpreter? What is its significance?

5 Answers  


Categories