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
compilation
:
Content language: English
Русский
What is the result of the following code compilation? class Quest3 { public static void main(String s[ ]) { String args; System.out.print(args + s); } }
compilation
Which lines will not cause compilation errors?
compilation
What will be the result of the following code compilation and execution? public class Base { public Object print() { return "Object from base method"; } public static void main(String[] args) { Base test = new Child(); System.out.println(test.print()); } } class Child extends Base { public String print() { return "String from child method"; } }
compilation
Select all modifiers that are applicable to top-level classes (not nested).
compilation
Will the following code compile? public class StartClass { private final String DUMMY = "DUMMY"; public static void main(String[] args) { System.out.println(DUMMY); } }
compilation
What changes will lead to a successful compilation of the following code? Select all that apply. public class LocalVsInstance { String s; public static void main(String[] args) { String s; System.out.println(s.toUpperCase()); LocalVsInstance localVsInstance = new LocalVsInstance(); System.out.println(localVsInstance.s.toUpperCase()); } }
compilation
Which line will the first compilation error occur in? public class Test { /* 1 */ public final static class A {} /* 2 */ static private class B {} /* 3 */ abstract static class C {} /* 4 */ static final private class D {} /* 5 */ final public abstract class E {} /* 6 */ static final abstract class F {} }
compilation
What is the result of the following code compilation and execution? public class Test1 { public static void main(String[] args) { int i = 1; i <<= 1; float f = 1; f = f << 1; System.out.println( i + ", " + f); } }
compilation
What will the following code display (ASCII code of '1' is 49)? public class Test { public static void main(String[] args) { char c1 = '1'; char c2 = '\u0031'; char c3 = 49; System.out.println(c1 + c2 + c3); } }
compilation
Select modifiers applicable to class fields:
compilation
← Prev
1
2
3
4
5
Next →
Sign Up Now
or
Subscribe for future quizzes