Quizzes
Site Language: English
Українська
English
Русский
Programming Tests
Login
Sign Up
Programming Tests
Theory
Snippets
Papers
Landing
Android
Prices
FAQ
Cosmo Story
Terms and Conditions
Privacy Policy
Cookies Policy
Send Feedback
nested classes
:
Content language: English
Русский
Inner classes in Java
nested classes
What types of nested classes do not exist (select all that apply)?
nested classes
Will this code be compile? 1: public class InnerExample { 2: public class Inner { 3: static final int x = 3; 4: static int y = 4; 5: } 6: static class Nested { 7: static int z = 5; 8: } 9: }
nested classes
What will be the result of compiling and running the following code: public class Test { public static void main(String[] s) { class Inn { static { System.out.print("Static "); } void m() { System.out.print("inner "); } } new Inn().m(); } }
nested classes
Which of these lines when placed in line 1 will create an instance of class Inner? (select all that apply). class Outer { public class Inner { } Inner getInner(){ return new Inner(); } public Outer() { } } public class Starter { public static void main(String[] args) { //1 } }
nested classes
← Prev
1
Next →
Sign Up Now
or
Subscribe for future quizzes