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()
           {
             System.out.println("Hello ");
           }

    }

} class Test { public statis void main(String args[]) {

       Outer objOuter = new Outer();
       Outer.Inner  objInner = objOuter.new Inner();

     }
}

My question is in the line : Outer.Inner objInner = objOuter.new Inner();

Here how objOuter.new works ?

Regards , Anup Kumar Mandal

View Answers









Related Tutorials/Questions & Answers:
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...[]) { Outer objOuter = new Outer(); Outer.Inner objInner = objOuter.new Inner
Inner class
{ i=new Inner(); } class Inner...("Inner"); } } } class...Inner class   //This code doesn't Works// import
Advertisements
inner class
inner class  what is mean by inner class   Inner class is a non-static class which is defined inside another class
Inner class
Inner class  how can i call outer class A `s method to print Outer... class TestInners { public static void main(String[] args) { new...(); class A { void m() { System.out.println("inner"); } } } class A { void m
Inner class
Inner class  when we use inner classed in java
I retrieve a String or other object type without creating a new object each time.
I retrieve a String or other object type without creating a new object each time.  How can I retrieve a String or other object type without creating a new object each time
Java inner class
Java inner class  What are inner class and anonymous class
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
Inner Class - Java Beginners
Inner Class  Hi, I have the following question. class Outer{ class Inner{ } public static void main(String[] args) { Outer.Inner inner = new Outer().new Inner(); } } If I compile the above code
java inner class - Java Beginners
with the enclosing class itself, whereas inner classes are associated with an object...java inner class  What is the difference between the nested class and inner class? Explain with suitable example.  Hi Friend
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
creating new file with File class - JSP-Interview Questions
creating new file with File class   I have a file uploading concept in my project. For that, while creating a new file is it necessary to give... of FileOutputStream class. If we give the path as from the file uploading location will it work
inner class - Java Interview Questions
inner classes are associated with an object of the enclosing class. The given...Java Inner Class  How many classes we can create in an inner class?  How many classes we can create in an inner class ANS :- Within Main
Class and object
Class and object  what is exact meaning for the statement, A a1=new B();   Hi, Here is two classes A and B. A is super class...(); You are creating the object of subclass Thanks
Java inner class and static nested class
Java inner class and static nested class  Java inner class and static nested class
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
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 - Java Interview Questions
Inner class  whether inner class can implement any interface(Runnable... Inner inner; private class Inner extends Thread { Inner(String name...() + ": " + countDown; } } public InnerClass1(String name) { inner = new Inner
Inner class in java
, a non-static nested class is actually associated to an object rather than to the class in which it is nested. For more details click on the following link Inner class in Java
object of object class
object of object class  what do u mean by "object of object class
class and Object
class and Object  how many classes,References and objects in this following statement.... A a=new B();   Hi,ADS_TO_REPLACE_1 In the statement: A a=new B(); There are 2 classes, Class A and Class B. References : 1
What is inner class in Java? - Java Beginners
What is inner class in Java?  Hi, Explain me inner classes in Java. What is the use of inner classes? Give examples of inner classes in Java...://www.roseindia.net/java/master-java/inner.shtml Uses: Non-static inner class
create a new object in JavaScript
create a new object in JavaScript  How do you create a new object in JavaScript
create a new object in JavaScript
create a new object in JavaScript  How do you create a new object in JavaScript
PHP Instanceof Operator
is used to check an object that whether this is an object of specified class or not. instanceof can also be used to determine whether an object of a class... also check that an object is not an instanceof a class, the  logical
Type Comparison Operator
;    Java provides a run-time operator instanceof to compare a class and an instance of that class. This operator " instanceof" compares an object to a specified class type. The instanceof operator is defined
Object class in java
Object class in java  want an example and with an explaination about equals() method in object class? Is equals() is similar
java object class methods
java object class methods  What are the methods in Object class?  There are lots of methods in object class. the list of some methods are as- clone equals wait finalize getClass hashCode notify notifyAll
Creating Volume Bar Using Gauge Class
Creating Volume Bar Using Gauge Class       This example is all about creating a volume bar using Gauge class. We are creating the object of Gauge class that contains
Anonymous Inner Classes - Anonymous Inner Classes tutorial
initiated anonymous inner class(here it is new ActionListener()) without creating... the instance of an object without creating subclass of a class and also performing... the inner class, there are two types of supplementary  inner classes
PHP Class Object
the object $a, we  call the function disp with -> operator. Any class can...PHP Class Object: In object oriented programming a class can be an abstract... apple, orange are the object of this class. Object is the instantiate
Does memory for Class or Object?
Does memory for Class or Object?   Does memory for class(methods & instance variables)allocated without it's object creation?If no,then The main() itself has associated with a class for which there is no instance creation,how
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
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 object of non static class Then if the above code is correct then why donĂ¢â
Creating Java Object in Vbscript - Development process
Creating Java Object in Vbscript  How to create a java object in Vbscript. Please give the detailed steps to create a java Object in Vbscript
Creating Data Access Object (DAO) Design Pattern
Creating Data Access Object (DAO) Design Pattern Data Access Object... the DAO class you can use in anywhere in you application by making an object of DAO class . For example- QuestionDAO obQuestionDAO = new QuestionDAO(); int
creating class and methods - Java Beginners
creating class and methods  Create a class Computer that stores... of the Computers. This class contains following methods, - Constructor method... ( ) method that creates array of 4 objects of Computer class and that takes input
OBJECT CLASS - Java Interview Questions
for a particular class you need to write code in the constructor in such a way that it keeps the track of the new instances of the class.Here is the example. class...OBJECT CLASS  How To Find Out How many Objects Create?How Many Object
The new keyword
an instance of a class or an array by using the new operator.ADS_TO_REPLACE_1 Creating a simple java object (non array object) by using the new operator. String sName = new String(); Creating an array object by using the new operator
In Java how to get size of class and object?
In Java how to get size of class and object?  In Java how to get size of class and object
In Java how to get size of class and object?
In Java how to get size of class and object?  In Java how to get size of class and object
Can you create an object of an abstract class?
Can you create an object of an abstract class?   Hi, Can you create an object of an abstract class? Thanks
Object Class Methods in Java
We are going to discus about Object Class Methods in Java...(), wait(), etc Java object class methods are:- finalize() clone() equals... system call its finalize() method. Object's class finalize method
Class, Object and Methods
for the Objectclass_name object_name = new class_name(); Output of the program...Class, Object and Methods       Class : Whatever we can see in this world all the things are a object
Limit the Class Object Creation
Limit the Class Object Creation In this section you will learn about how a class object creation can be a restricted to a fix number of times... to restrict the object creation of a class. This is a simple code in Java where I have
c++ new, delete, string class
c++ new, delete, string class  Write one program containing all... contained in string1: Exercise 1 Good morning Create a new string named string2... Exercise 5 69 Create a new string named string6 containing the contents from
what is the working of JVM when An object is created of a class?
what is the working of JVM when An object is created of a class?  what is the working of JVM when An object is created of a class?   When the JVM creates the instance of your class object,the object instance is stored
How to access sub class member using super class object
How to access sub class member using super class object  class A{ } class B extends A{ int b=1; } class Test{ public static void main(String args[]) { what to do here to access sub class variable b using super class object
The new keyword in java
. The new operator instantiate a class by allocating memory for a new object and returning a reference to that memory. The new operator also invoke object constructor. The new operator returns a reference to the object it created
Java - Class, Object and Methods in Java
Syntax for the Objectclass_name object_name = new class_name(); Output... Java - Class, Object and Methods in Java   ... with its class that mean almost all the properties of the object should be matched

Ads