Tag: science & technology

Questions Related to science & technology

Multiple choice general knowledge science & technology
  1. init()

  2. start()

  3. run()

  4. resume()

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

In Java threading, the start() method is used to begin execution of a thread. When start() is called, the JVM creates a new thread and invokes the run() method within that new thread. The init() method is not a standard thread method, run() contains the thread's body but doesn't start execution, and resume() is deprecated. The start() method is specifically designed for thread initialization and execution.

Multiple choice general knowledge science & technology
  1. run()

  2. start()

  3. stop()

  4. main()

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

In Java's threading model, the run() method contains the body or actual code that the thread executes. When a thread is started using start(), it internally calls run() to execute the thread's task. The start() method only initiates thread execution, stop() is deprecated, and main() is the program entry point unrelated to threading. The run() method must be overridden or implemented to define thread behavior.

Multiple choice general knowledge science & technology
  1. Object

  2. Thread

  3. Runnable

  4. Class

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

The wait(), notify(), and notifyAll() methods are defined in the Object class in Java, not in Thread or Runnable. This design allows all objects to be used as locks or monitors for thread synchronization. Every object in Java inherits these methods from Object. The Thread class provides methods for thread management, while Runnable is an interface for defining thread tasks. Only Object defines these fundamental synchronization methods.

Multiple choice general knowledge science & technology
  1. void run()

  2. public void run()

  3. public void start()

  4. void run(int priority)

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

The Runnable interface requires implementing the run() method with public void run() signature. The method must be public (to be called by the thread) and void (no return value). Option A (void run()) lacks the public modifier, making it inaccessible. Option C (public void start()) is incorrect because Runnable doesn't define start(). Option D (void run(int priority)) has wrong signature and parameters. The exact signature public void run() is mandated by the interface contract.

Multiple choice general knowledge science & technology
  1. excess electron

  2. excess proton

  3. excess neutron

  4. excess neutrino

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

In nuclear reactors, moderators are used to slow down fast neutrons produced during fission. Moderators absorb excess neutrons' kinetic energy (not the neutrons themselves) through collisions, reducing them to thermal energies suitable for sustaining the chain reaction. Option C is the intended answer though the wording 'absorb excess neutron' is imprecise.

Multiple choice general knowledge science & technology
  1. Atom bomb

  2. Hydrogen Bomb

  3. Nuclear bomb

  4. All the above

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

Hydrogen bombs (thermonuclear weapons) are significantly more powerful than atomic bombs (fission weapons). Hydrogen bombs use both fission and fusion processes, whereas atomic bombs only use fission. The energy released by fusion is much greater, making hydrogen bombs far more destructive.