Tag: programming languages

Questions Related to programming languages

Multiple choice technology programming languages
  1. Color skyColor = BLUE;

  2. Color treeColor = Color.GREEN;

  3. Color purple = new Color( 0xff00ff);

  4. if( Color.RED.ordinal() < Color.BLUE.ordinal() ) {}

Reveal answer Fill a bubble to check yourself
B,D Correct answer
Multiple choice technology programming languages
  1. Mr. John Doe

  2. An exception is thrown at runtime

  3. Compilation fails because of an error in line 12

  4. Compilation fails because of an error in line 15

Reveal answer Fill a bubble to check yourself
A Correct answer
Multiple choice technology programming languages
  1. public void logIt(String * msgs)

  2. public void logIt(String [] msgs)

  3. public void logIt(String... msgs)

  4. public void logIt(String msg1, String msg2, String msg3)

Reveal answer Fill a bubble to check yourself
C Correct answer
Multiple choice technology programming languages
  1. itemID(int itemId)

  2. update(int itemId)

  3. setItemId(int itemId)

  4. mutateItemId(int itemId)

Reveal answer Fill a bubble to check yourself
C Correct answer
Multiple choice technology programming languages
  1. Compilation of class A fails

  2. Line 28 prints the value 3 to System.out

  3. Line 28 prints the value 1 to System.out.

  4. A runtime error occurs when line 25 executes

Reveal answer Fill a bubble to check yourself
A Correct answer
Multiple choice technology programming languages
  1. public void foo() { }

  2. public int foo() { return 3; }

  3. public Two foo() { return this; }

  4. public Object foo() { return this; }

Reveal answer Fill a bubble to check yourself
C Correct answer
Multiple choice technology programming languages
  1. int foo() { /* more code here */ }

  2. void foo() { /* more code here */ }

  3. public void foo() { /* more code here */ }

  4. protected void foo() { /* more code here */ }

Reveal answer Fill a bubble to check yourself
B,C,D Correct answer
Multiple choice technology programming languages
  1. Compilation will succeed for all classes and interfaces.

  2. Compilation of class C will fail because of an error in line 2.

  3. Compilation of class C will fail because of an error in line 6.

  4. Compilation of class AImpl will fail because of an error in line 2.

Reveal answer Fill a bubble to check yourself
C Correct answer