Tag: programming languages

Questions Related to programming languages

Given: 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--; } } } What is the result?

  1. 8

  2. 8 7

  3. 8 7 6

  4. Compilation fails

  5. An exception is thrown at runtime


Correct Option: D
  1. Compilation fails

  2. Pi is approximately 3

  3. Pi is approximately 3.141593

  4. An exception is thrown at runtime


Correct Option: D
  1. Inheritance represents an is-a relationship

  2. . Inheritance represents a has-a relationship

  3. Interfaces must be used when creating a has-a relationship

  4. Instance variables can be used when creating a has-a relationship


Correct Option: A,D
  1. Compilation fails.

  2. An exception is thrown at runtime.

  3. The code executes normally and prints "sleep".

  4. The code executes normally, but nothing is print ed.


Correct Option: C
  1. . Line 1 will not compile

  2. . Line 2 will not compile

  3. . Line 3 will not compile

  4. . Line 4 will not compile


Correct Option: A,D
  1. select * from EMP where nvl(EMPNO, '00000') = '59384';

  2. select * from EMP where EMPNO = '59384';

  3. select EMPNO, LASTNAME from EMP where EMPNO = '59384';

  4. select 1 from EMP where EMPNO = '59834';


Correct Option: A