Java Fundamentals and Legacy APIs
Covers core Java programming concepts including syntax, OOP, threading, collections, I/O, and historical APIs like applets and AWT
Questions
Which of the following variable declarations is valid in Java?
- 5sum
- Not/Ok
- AvgSpeed
- current-temp
- Del hi
Which of the following applications in Java is designed to be transmitted over the internet and executed by a Java compatible web browser?
- Bytecode
- Applet
- Multi-threaded
- Architectural neutral
- Portability
Which of the following symbols is used in Java to separate consecutive identifiers in a variable declaration?
- Braces
- Comma
- Period
- Parentheses
- Brackets
_____________ is the property of Java which enables one object to acquire the property of another object.
- Encapsulation
- Abstraction
- Inheritance
- Polymorphism
- Robust
Which of the following methods of ThreadGroup class returns the maximum priority set for the group?
- getMaxPriority()
- setMaxPriority()
- updateMaxPriority()
- interrupt()
- getName()
Which of the following interfaces in Thread class must be implemented by any class that will initiate a separate thread of execution?
- Thread
- StrictMath
- Runnable
- Compiler
- run()
Which of the following methods of Package class returns the name of the implementor of the invoking package?
- getImplementationTitle()
- getImplementationVendor()
- getImplementationVersion()
- getSpecificationTitle()
- getSpecificationVendor()
Which of the following restrictions to static method is not correct?
- They can only call static methods.
- They must only access static data.
- They cannot refer to 'this' keyword.
- They cannot refer to 'super' keyword.
- Static data cannot be initialized.
Which of the following methods of Method class returns true value if the object argument is an element of the invoking collection?
- add()
- clear()
- contains()
- equals()
- hashCode()
Which of the following methods of Vector class returns the element at the location specified by the argument in the method?
- firstElement()
- indexOf()
- elementAt()
- enumeration elements()
- capacity()
Which of the following classes in Java is an abstract class that defines Java's model of streaming character input?
- Writer
- Reader
- FileReader
- PrintStream
- SequenceInputStream
Which of the following methods is called to begin an applet execution?
- start()
- stop()
- init()
- isActive()
- destroy()
Which of the following methods of Stack class is used to search for an element in the stack?
- peek()
- pop()
- push()
- search()
- empty()
Which of the following event classes is generated from the java.awt.event package when a scroll bar is manipulated?
- ActionEvent
- AdjustmentEvent
- FocusEvent
- ComponentEvent
- InputEvent
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?
- CODE
- ALT
- CODEBASE
- NAME
- PARAM