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
visibility and scope
:
Content language: English
Русский
What is the result of the following program compilation and execution? public class Test { public static void main(String[] args) { int i = 1; long j = 1; if (i == 1) { int k = 1; if (i == k) { System.out.println("i equals k"); } } else if (j == k) { System.out.println("j equals k"); } } }
visibility and scope
What is the following program`s execution result? class Tack { static short s = 17; public Tack(short ss) { new Tack(); s *= ss; } public Tack() { ; } } public class Bridle extends Tack { public Bridle(int s) { System.out.println(s + 1); } public static void main(String[] args) { Bridle b = new Bridle(3); } }
visibility and scope
What will be the result of the main method in the Main class execution? public class Main { private int anInt = 4; public Main() { anInt = 5; } public static void main(String[] args) { Main m = new Main(); int anInt = 6; m.print(anInt); } public void print(int anInt){ System.out.println(anInt); } }
visibility and scope
← Prev
1
Next →
Sign Up Now
or
Subscribe for future quizzes