programming languages Online Quiz - 134
Description: programming languages Online Quiz - 134 | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: programming languages |
Which are most typically thrown by an API developer or an application developer as opposed to being thrown by the JVM.
class Hello{} class Hai extends Hello{} class Me{ static int x=7; static String s=null; public static void getWeight(Hello m){ int y=0/x; System.out.print(s+""); } public static void main(String [] args){ Hello [] ha={new Hello(),new Hai()}; for(Object o:ha) getWeight((Hello)o); } } When i run as--- java Me.java
What is the result? class Circus { public static void main(String[] args) { int x = 9; int y = 6; for(int z = 0; z < 6; z++, y--) { if(x > 2) x--; label: if(x > 5) { System.out.print(x + " "); --x; continue label; } x--; } } }
Which are methods of the Object class? (Choose all that apply.)
- class X { void do1() { } } 2. class Y extends X { void do2() { } } 3. 4. class Chrome { 5. public static void main(String [] args) { 6. X x1 = new X(); 7. X x2 = new Y(); 8. Y y1 = new Y(); 9. // insert code here 10. } 11. } Which, inserted at line 9, will compile? (Choose all that apply.)
class Scoop { static int thrower() throws Exception { return 42; } public static void main(String [] args) { try { int x = thrower(); } catch (Exception e) { x++; } finally { System.out.println("x = " + ++x); } } } What is the result?
class Fizz { int x = 5; public static void main(String[] args) { final Fizz f1 = new Fizz(); Fizz f2 = new Fizz(); Fizz f3 = FizzSwitch(f1,f2); System.out.println((f1 == f3) + " " + (f1.x == f3.x)); } static Fizz FizzSwitch(Fizz x, Fizz y) { final Fizz z = x; z.x = 6; return z; } } What is the result?
What will be the output of the following program?
What is the output of the program?
Which of these statements are true?