Menu
Topics Index
...
`

Inner Classes2104


If you need explanation Read this topic

If you need Answer Take test on this topic

Inner Classes2104
What will be the output of the following program?
public class Duos {
    public static void main(String[] args) {
        new Duos().new D().new U().new O().new S().new II().Single();
    }
    class D {
        class U {
            class O {
                class S {
                    class II {
                        public void Single() {
                            System.out.println("Samsung Mobile DUOS S7562");
                        }
                    }
                }
            }
        }
    }
}

A. Samsung Mobile DUOS S7562
B. Some other output
C. Output can not be determined
D. Compilation Error or Runtime Error
Topic: Advanced Java Programming Concepts

If you need explanation Read this topic

If you need Answer Take test on this topic

User comments below. All of them might not be correct.

Answer a. by calling single() method it prints output insid the multiple class

Posted by NagaRaj Nataraj    2014-06-05 09:04:20


Ans:A we can call the single() by using the above procedure.

Posted by Indra Chereddy    2014-06-05 09:05:05


ans:D

Posted by Ashok Reddi    2014-06-05 09:07:15


Ans:D Compilation Error. The class D cannot be called using an instance of the class Duos.

Posted by Priyanka Madiraju    2014-06-05 09:07:35


ans a. single() called ans it prints output

Posted by Maheshwari Natarajan    2014-06-05 09:20:54


Congratulations NagaRaj Nataraj. You are this dose winner. We will send you the link using which you can claim your recharge.

Posted by Merit Campus    2014-06-06 04:22:22


© meritcampus 2019

All Rights Reserved.

Open In App