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...


Why are inner classes required?

Answers were Sorted based on User's Feedback



Why are inner classes required?..

Answer / qamrun nisa

when an inner class is defined it is a member of the outer
class in much the same way as other members like attributes,
methods and constructors. When we access private data
members of the outer class, the JDK compiler creates
package-access member functions in the outer class for the
inner class to access the private members. This leaves a
security hole.

In general we should avoid using inner classes. Use inner
class only when an inner class is only relevant in the
context of the outer class and/or inner class can be made
private so that only outer class can access it. Inner
classes are used primarily to implement helper classes like
Iterators, Comparators etc which are used in the
context of an outer class.

Is This Answer Correct ?    7 Yes 0 No

Why are inner classes required?..

Answer / shubha patil

inner class is basically used for binding the one class into
another class.

Is This Answer Correct ?    0 Yes 1 No

Why are inner classes required?..

Answer / mohammad aleemuddin

Inner classes are mainly used to encapsulate the data

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More Core Java Interview Questions

How can you debug the Java code?

6 Answers   BirlaSoft,


what is difference between global methods and local methods?

1 Answers  


Are maps ordered java?

0 Answers  


How to Create A Wapper Class in core Java and Why are Use in java?

2 Answers   Amdocs,


What is difference between filereader and bufferedreader?

0 Answers  


Is linked list a linear or non-linear data structure?

0 Answers   Akamai Technologies,


What is implicit object in java?

0 Answers  


How to sort array of 0 and 1 in java?

0 Answers  


Name the method that used to clear the buffer ?

2 Answers  


What is a stack class in java ?

0 Answers   Akamai Technologies,


What is the difference between superclass and subclass?

0 Answers  


Can you instantiate the math class in Java?

0 Answers   IBS,


Categories