Java Fundamentals and Legacy APIs

Covers core Java programming concepts including syntax, OOP, threading, collections, I/O, and historical APIs like applets and AWT

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following variable declarations is valid in Java?

  1. 5sum
  2. Not/Ok
  3. AvgSpeed
  4. current-temp
  5. Del hi
Question 2 Multiple Choice (Single Answer)

Which of the following applications in Java is designed to be transmitted over the internet and executed by a Java compatible web browser?

  1. Bytecode
  2. Applet
  3. Multi-threaded
  4. Architectural neutral
  5. Portability
Question 3 Multiple Choice (Single Answer)

Which of the following symbols is used in Java to separate consecutive identifiers in a variable declaration?

  1. Braces
  2. Comma
  3. Period
  4. Parentheses
  5. Brackets
Question 4 Multiple Choice (Single Answer)

_____________ is the property of Java which enables one object to acquire the property of another object.

  1. Encapsulation
  2. Abstraction
  3. Inheritance
  4. Polymorphism
  5. Robust
Question 5 Multiple Choice (Single Answer)

Which of the following methods of ThreadGroup class returns the maximum priority set for the group?

  1. getMaxPriority()
  2. setMaxPriority()
  3. updateMaxPriority()
  4. interrupt()
  5. getName()
Question 6 Multiple Choice (Single Answer)

Which of the following interfaces in Thread class must be implemented by any class that will initiate a separate thread of execution?

  1. Thread
  2. StrictMath
  3. Runnable
  4. Compiler
  5. run()
Question 7 Multiple Choice (Single Answer)

Which of the following methods of Package class returns the name of the implementor of the invoking package?

  1. getImplementationTitle()
  2. getImplementationVendor()
  3. getImplementationVersion()
  4. getSpecificationTitle()
  5. getSpecificationVendor()
Question 8 Multiple Choice (Single Answer)

Which of the following restrictions to static method is not correct?

  1. They can only call static methods.
  2. They must only access static data.
  3. They cannot refer to 'this' keyword.
  4. They cannot refer to 'super' keyword.
  5. Static data cannot be initialized.
Question 9 Multiple Choice (Single Answer)

Which of the following methods of Method class returns true value if the object argument is an element of the invoking collection?

  1. add()
  2. clear()
  3. contains()
  4. equals()
  5. hashCode()
Question 10 Multiple Choice (Single Answer)

Which of the following methods of Vector class returns the element at the location specified by the argument in the method?

  1. firstElement()
  2. indexOf()
  3. elementAt()
  4. enumeration elements()
  5. capacity()
Question 11 Multiple Choice (Single Answer)

Which of the following classes in Java is an abstract class that defines Java's model of streaming character input?

  1. Writer
  2. Reader
  3. FileReader
  4. PrintStream
  5. SequenceInputStream
Question 12 Multiple Choice (Single Answer)

Which of the following methods is called to begin an applet execution?

  1. start()
  2. stop()
  3. init()
  4. isActive()
  5. destroy()
Question 13 Multiple Choice (Single Answer)

Which of the following methods of Stack class is used to search for an element in the stack?

  1. peek()
  2. pop()
  3. push()
  4. search()
  5. empty()
Question 14 Multiple Choice (Single Answer)

Which of the following event classes is generated from the java.awt.event package when a scroll bar is manipulated?

  1. ActionEvent
  2. AdjustmentEvent
  3. FocusEvent
  4. ComponentEvent
  5. InputEvent
Question 15 Multiple Choice (Single Answer)

Which of the following attributes of an applet specifies the base URL of the applet code that is the directory to search applet's executable class file?

  1. CODE
  2. ALT
  3. CODEBASE
  4. NAME
  5. PARAM