Tag: science & technology

Questions Related to science & technology

Multiple choice general knowledge science & technology
  1. run-time error

  2. aabbaabb

  3. bbbbaaaa

  4. abababab

  5. aaaabbbb

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

The code creates two PrintChar objects and calls run() directly (not start()). This means they run sequentially in the main thread, not as separate threads. printA.run() completes first (printing 'aaaa'), then printB.run() executes (printing 'bbbb'), resulting in 'aaaabbbb'. The code doesn't actually create multi-threading.

Multiple choice general knowledge science & technology
  1. float f = 1.3;

  2. byte b = 257;

  3. int i = 10;

  4. boolean b = null;

  5. char c = "a";

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Only 'int i = 10' compiles without error. 'float f = 1.3' fails because 1.3 is a double literal requiring casting or 'f' suffix. 'byte b = 257' fails because 257 exceeds byte's range (-128 to 127). 'boolean b = null' fails because booleans can't be null. 'char c = "a"' fails because "a" is a String, not a char.

Multiple choice general knowledge science & technology
  1. if

  2. then

  3. else

  4. for

  5. while

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In Java, 'if', 'else', 'for', and 'while' are reserved keywords used for control flow statements. The word 'then' is NOT a keyword in Java - Java uses if-else statements without requiring 'then' (unlike some other languages). The 'then' keyword is used in languages like Pascal or Visual Basic but not in Java syntax.

Multiple choice general knowledge science & technology
  1. Held together by electrical forces

  2. Invisible

  3. Mostly empty space themselves

  4. Not as close together as they could be

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Atoms themselves are about 99.9% empty space, with most of the mass in a tiny nucleus and electrons occupying the surrounding space. Since matter is made of atoms, a granite block is also mostly empty space.

Multiple choice general knowledge science & technology
  1. Violet

  2. White

  3. Blue

  4. Red

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The energy difference between excited and ground states corresponds to green light. Decay to an intermediate state means a smaller energy gap, which produces a lower-energy photon with longer wavelength. Red has longer wavelength than green in the visible spectrum.