about inner class

about inner class

class Outer { class Inner{ public void m1(){ System.out.println("Inner class Method"); } } public void m2(){ Inner i = new Inner(); i.m1(); } public static void main(String ar[]){ Outer o = new Outer(); o.m2(); } }

in this i got compile time error as: cannot find symbol method m2() class Outer

please tell me, if any coding error and tell me the resolution for the above program

View Answers

Ads









Related Tutorials/Questions & Answers:
about inner class
about inner class  class Outer { class Inner{ public void m1(){ System.out.println("Inner class Method"); } } public void m2(){ Inner i = new Inner...() class Outer please tell me, if any coding error and tell me the resolution
inner class
inner class  what is mean by inner class   Inner class is a non-static class which is defined inside another class
Advertisements
Inner class
{ i=new Inner(); } class Inner...("Inner"); } } } class...Inner class   //This code doesn't Works// import
Inner class
Inner class  how can i call outer class A `s method to print Outer. class A { void m() { System.out.println("outer"); } } public...(); class A { void m() { System.out.println("inner"); } } } class A { void m
Inner class
Inner class  when we use inner classed in java
Java inner class and static nested class
Java inner class and static nested class  Java inner class and static nested class
ModuleNotFoundError: No module named 'inner-class'
ModuleNotFoundError: No module named 'inner-class'  Hi, My Python... 'inner-class' How to remove the ModuleNotFoundError: No module named 'inner-class' error? Thanks   Hi, In your python environment
Inner class in java
Inner class in java In this example we will describe inner classes in java. Inner class declared inside a class. The inner class also call Nested classes... class parts of Nested Class. Inner classes are related by different names
Inner class - Java Interview Questions
Inner class  whether inner class can implement any interface(Runnable... Inner inner; private class Inner extends Thread { Inner(String name...(name); } } // Using an anonymous inner class: class InnerClass2
Use of Local Inner class
Use of Local Inner class     ... class. Such a class is defined as Nested Class or Local Inner class. The Nested Class are classified into - 1)Static Nested Inner class are declared static called
new operator for creating the object of inner class
new operator for creating the object of inner class  Hi , The folliowing is my code : class Outer { class Inner{ void show... "); } } } class Test { public statis void main(String args
about the base class of file
about the base class of file  what is the basic class of file
About Static Class
About Static Class  is it neccessary to create object for static class
What is the difference between a static and a non-static inner class?
What is the difference between a static and a non-static inner class?   Hi, What is the difference between a static and a non-static inner class? Thanks
Inner classes
course . I have one question about inner classes . question is how... there is Inner class defined . A) Outer ob = new Outer(); Ob.display(); // calling instance method of Outer class Outer.Inner ob1= ob.new Inner(); // creating
Anonymous Inner Classes - Anonymous Inner Classes tutorial
the inner class, there are two types of supplementary  inner classes : The inner class which is declared inside the body of a method is known as the local inner classes. The class declared inside the body of a method without naming
Nested and Inner classes
a nested class. Inner class is a non static class declared inside another class.Non-static inner class keep the reference of outer class and allow to access member...Nested and Inner classes  What is the significance of Inner Classes
About Main
About Main  can u create the object of one interface ? But i can able to create the abstract class through anonimous inner class.similarly can i
About Main
About Main  can u create the object of one interface ? But i can able to create the abstract class through anonimous inner class.similarly can i
SQL INNER Joins
_name, s.stu_class, l.lib_no from stu_table as s inner JOIN lib_table as l... SQL INNER Joins      .... Understand with Example The Tutorial illustrate an example from SQL INNER
Class AsyncEvent important methods
In this section, you will learn about the important methods of AsyncEvent Class
ModuleNotFoundError: No module named 'inner'
ModuleNotFoundError: No module named 'inner'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'inner' How to remove the ModuleNotFoundError: No module named 'inner'
The link to the outer class,java tutorial,java tutorials
example will give you clear idea about inner or outer classes : class Outer...Nested Classes: Inner & Outer Class The classes which are defined within...; as Inner Class. The Class in which inner class resides are known as Outer Class
Java AWTException Class Hierarchy Diagram
Java AWTException Class Hierarchy Diagram In this section we will discuss about the class hierarchy of AWTException Class in Java. This class extends the java.lang.Exception class. This exception indicates an Abstract Window Toolkit
Java AlreadyBoundException Class Hierarchy Diagram
Java AlreadyBoundException Class Hierarchy Diagram In this section we will discuss about the class hierarchy of AlreadyBoundException Class in Java. This class extends the java.lang.Exception class. This exception occurs when tried
Java BackingStoreException Class Hierarchy Diagram
Java BackingStoreException Class Hierarchy Diagram In this section we will discuss about the class hierarchy of BackingStoreException Class diagram in Java. This class extends the java.lang.Exception class. This exception is generally
Class
on the particular properties of the class or its group. We can understand about the class... Class, Object and Methods       Class : Whatever we can see in this world all the things
Java ApplicationException Class Hierarchy Diagram
Java ApplicationException Class Hierarchy Diagram In this section we will discuss about the class hierarchy of ApplicationException Class in Java. This class extends the java.lang.Exception class. ApplicationException reports
Inner Classes In Java
as a non-static member of an enclosing class. This type of inner class... Inner Classes In Java      ... can be termed as the inner classes. --  Inner classes provides an elegant
Java ActivationException Class Hierarchy Diagram
Java ActivationException Class Hierarchy Diagram In this section we will discuss about the class hierarchy of ActivationException Class in Java. This class extends the java.lang.Exception class. Activation interfaces uses
class
is a class to represent a country in medal tally. It has an attribute of country... medals. In this class, you should also define constructors, and assessor, mutator methods. Task 2 MedalTally.java is a class to model a medal tally, containing

Ads