Prepare
Practice
Interview
Aptitude
Reasoning
English
GD
Placement papers
HR
Current affairs
Engineering
MCA
MBA
Online test
Login
Online Practice Test
>
Java 3
« Previous
Next »
Which statement is true?
Options
- An anonymous inner class can access final variables in any
- enclosing scope.
- An anonymous inner class may be declared as protected.
- An anonymous inner class can implement multiple interface.
CORRECT ANSWER : enclosing scope.
Discussion Board
soln
class Outer
{
int ox=100;
void test(){
Inner inner= new Inner();
inner.Display();
}
class Inner{
void Display()
{
S.o.p("Display : ox"+ox);
}
}
}
from above code we can visualise we can acces data member of outer class without creating its object..
Piush 07-2-2014 01:39 PM
« Previous
Next »
Write your comments
*
*
Email must be in the form someone@domain.com
*
*
Enter the code shown above:
Please enter the code shown above
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)
Related Content
Java Beginner (11)
Java (39)
Java (40)
Java (22)
Java (30)
Java (25)
Java (20)
Java (20)
Core Java (20)
Core Java (10)
Core Java (72)
EJB (20)
JDBC (20)
Applet (20)
Struts (21)
Servlets (20)
Java Web Services (20)
Javascript (40)
J2EE (10)
jQuery (46)
Advertisement
▲