Java Programming Basics and Oracle Database Administration

A quiz covering fundamental Java programming concepts including loops, operators, and program output, as well as Oracle database administration topics such as tablespaces, user management, and SQL functions.

5 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Provide a declaration for i that turns this loop into an infinite loop: while( i != i){ }

  1. String i = "abc"
  2. double i = 0.0/0.0
  3. int i = 3/7
  4. int i = 0
Question 2 Multiple Choice (Single Answer)

Provide a declaration for i that turns this loop into infinite loop: while( i != i + 0){ }

  1. Char i = 9
  2. int i = 3/7
  3. String i = "abc"
  4. int i = 0
Question 3 Multiple Choice (Single Answer)

Is this a legal Java Program? If so, what does it print? \u0070\u0075\u0062\u006c\u0069\u0063\u0020\u0020\u0020\u0020 \u0063\u006c\u0061\u0073\u0073\u0020\u0055\u0067\u006c\u0079 \u007b\u0070\u0075\u0062\u006c\u0069\u0063\u0020\u0020\u0020 \u0020\u0020\u0020\u0020\u0073\u0074\u0061\u0074\u0069\u0063 \u0076\u006f\u0069\u0064\u0020\u006d\u0061\u0069\u006e\u0028 \u0053\u0074\u0072\u0069\u006e\u0067\u005b\u005d\u0020\u0020 \u0020\u0020\u0020\u0020\u0061\u0072\u0067\u0073\u0029\u007b \u0053\u0079\u0073\u0074\u0065\u006d\u002e\u006f\u0075\u0074 \u002e\u0070\u0072\u0069\u006e\u0074\u006c\u006e\u0028\u0020 \u0022\u0048\u0065\u006c\u006c\u006f\u0020\u0077\u0022\u002b \u0022\u006f\u0072\u006c\u0064\u0022\u0029\u003b\u007d\u007d

  1. Its not possible
  2. print some garbage value
  3. compilation error
  4. Hello world
Question 4 Multiple Choice (Single Answer)

What does it print? public class Elementary { public static void main(String[] args) { System.out.println(12345 + 5432l); } }

  1. Compilation error
  2. Runtime error
  3. 17777
  4. 66666
Question 5 Multiple Choice (Single Answer)

What happens when the following code is compiled and run. Select the one correct answer. for(int i = 2; i < 4; i++) for(int j = 2; j < 4; j++) if(i < j) assert i!=j : i;

  1. The class compiles and runs, but does not print anything.
  2. The number 2 gets printed with AssertionError
  3. compile error
  4. The number 3 gets printed with AssertionError