IndiaBIX.com
Arithmetic Aptitude Data Interpretation
Logical Reasoning Verbal Reasoning Non Verbal Reasoning
General Knowledge
Sudoku Number puzzles Missing letters puzzles Logical puzzles Playing cards puzzles Clock puzzles
C Programming C++ Programming C# Programming Java Programming
Microbiology Biochemistry Biotechnology Biochemical Engineering
Chemical Engineering Networking Database Questions Computer Science Basic Electronics Digital Electronics Electronic Devices Circuit Simulation Electrical Enigneering Engineering Mechanics Technical Drawing
Placement Papers Group Disucssion HR Interview Technical Interview Body Language
Aptitude Test Verbal Ability Test Verbal Reasoning Test Logical Reasoning Test C Programming Test Java Programming Test Data Interpretation Test General Knowledge Test
Data Structures Operating Systems Networking DATABASE Database Basics SQL Server Basics SQL Server Advanced SQL Server 2008 JAVA Core Java Java Basics Advanced Java UNIX Unix File Management Unix Memory Management Unix Process Managemnt C Interview Questions The C Language Basics .NET Interview Questions .NET Framework ADO.NET ASP.NET Software Testing

Java Programming - Inner Classes - Discussion

@ : Home > Java Programming > Inner Classes > General Questions - Discussion

Read more:

"Nothing is impossible to a willing heart."
- (Proverb)
1. 

Which is true about an anonymous inner class?

[A]. It can extend exactly one class and implement exactly one interface.
[B]. It can extend exactly one class and can implement multiple interfaces.
[C]. It can extend exactly one class or implement exactly one interface.
[D]. It can implement multiple interfaces regardless of whether it also extends a class.

Answer: Option A

Explanation:

Option C is correct because the syntax of an anonymous inner class allows for only one named type after the new, and that type must be either a single interface (in which case the anonymous class implements that one interface) or a single class (in which case the anonymous class extends that one class).

Option A, B, D, and E are all incorrect because they don't follow the syntax rules described in the response for answer Option C.


Arkadeep said: (Thu, Jun 16, 2011 05:04:39 AM)    
 
Please give details about inner classes. Are they different from child classes?

Ravi Shankar said: (Fri, Aug 12, 2011 12:54:23 AM)    
 
Yes in child class you can implement any no. Of interface but in inner class only implement one interface or can extend one interface.

Zishan said: (Wed, Sep 21, 2011 02:23:55 AM)    
 
I don't understand exact meaning. Please explain in detail with example.

Write your comments here:
Name *:     Email:


© 2008-2012 by IndiaBIX™ Technologies. All Rights Reserved | Copyright | Terms of Use & Privacy Policy

Contact us: info@indiabix.com     Follow us on twitter!