Tag: programming languages

Questions Related to programming languages

Multiple choice technology programming languages
  1. Locale loc = Locale.getLocale();System.out.println(loc.getDisplayCountry()+ “ “+ df.format(d));

  2. Locale bc = Locale.getLocale();System.out.println(loc.getDisplayCountry()+ “ “+ df.setDateFormat(d));

  3. Locale loc = Locale.getDefault();System.out.println(loc.getDisplayCountry()+ “ “+ df.setDateFormat(d));

  4. Locale loc = Locale.getDefault(); System.out.println(loc.getDisplayCountry()+ “ “ + df.format(d));

Reveal answer Fill a bubble to check yourself
D Correct answer
Multiple choice technology programming languages
  1. The class is fully encapsulated

  2. The ownerName variable breaks encapsulation

  3. The cardlD and limit variables break polymorphism

  4. The setCardlnformation method breaks encapsulation

Reveal answer Fill a bubble to check yourself
B Correct answer
Multiple choice technology programming languages
  1. Euro returns correct values

  2. An exception is thrown at runtime.

  3. Yen and Euro both return correct values

  4. Compilation fails because of an error at line 25.

Reveal answer Fill a bubble to check yourself
A,D Correct answer
Multiple choice technology programming languages
  1. The time to determine whether a Person object is contained in a HashSet is constant and does NOT depend on the size of the map

  2. Deleting a Person key from a HashMap will delete all map entries for all keys of type Person

  3. Inserting a second Person object into a HashSet will cause the first Person object to be removed as a duplicate.

  4. The time to find the value from HashMap with a Person key depends on the size of the map.

Reveal answer Fill a bubble to check yourself
D Correct answer
Multiple choice technology programming languages
  1. Compilation fails.

  2. An exception is thrown at runtime

  3. doStuffx = 6 main x = 6

  4. doStuffx = 5 main x = 5

Reveal answer Fill a bubble to check yourself
D Correct answer
Multiple choice technology programming languages
  1. import com.sun.scjp.Geodetics;public class TerraCarta {public double halfway(){ return Geodetics.DIAMETER/2.0; } }

  2. import static com.sun.scjp.Geodetics;public class TerraCarta {public double halfway() { return DIAMETER/2.0; } }

  3. import static com.sun.scjp.Geodetics. *;public class TerraCarta {public double halfway() { return DIAMETER/2.0; } }

  4. package com.sun.scjp;public class TerraCarta {public double halfway() { return DIAMETER/2.0; } }

Reveal answer Fill a bubble to check yourself
A,C Correct answer
Multiple choice technology programming languages
  1. Foo { public int bar() { return 1; } }

  2. new Foo { public int bar() { return 1; } }

  3. newFoo() { public int bar(){return 1; } }

  4. new class Foo { public int bar() { return 1; } }

Reveal answer Fill a bubble to check yourself
C Correct answer