Java Programming Fundamentals
Comprehensive quiz covering Java core concepts including OOP, multithreading, exceptions, JDBC, and GUI programming with AWT/Swing. Ideal for BCA, MCA, and BE students preparing for Java exams.
Questions
Java is a _____ language.
- procedural
- object oriented
- web development
- event driven
Which of the following is NOT a part of JDK?
- Java Compiler
- JDBC Driver
- Applet Viewer
- Sample Codes
The _________ package is the default package included into every Java program.
- Java. lang
- Java. io
- Java. awt
- Java. applet
The Java compiler is called 'java c'.
- True
- False
Which of the following is NOT a part of Applet life cycle?
- paint
- stop
- start
- init
The _______ exception is thrown when a method is called with illegal arguments.
- illegal args
- illegal argument
- illegal arguments
- illegal arg
Rajiv wants to create a password box. He must use the _______ property so that the data is displayed in the form of symbols
- set Char (char)
- set Echo Char (char)
- set Char Echo (char)
- set Char At (char)
________ is a process which ensures that the resource will be used by only one thread at a time.
- Reload
- Synchronization
- Notify
- Refresh
The programmers of ' Softek' are in a fuss on how to create a non inheritable class, advice them to use ___ keyword
- Final
- Static
With reference to JDBC, arrange the following steps in ascending order:
- Create Statement 2. Execute Query 3. Get Connection 4. Register Driver
- 3, 4, 1, 2
- 4, 3, 1, 2
- 3, 4, 2, 1
- None of the above
The method '____' waits for a thread to die.
- join
- stop
- enumerate
- yield
Which of the following is NOT a member of the 'Window Listener' interface?
- Window Activated
- window Closed
- Window Opened
- Window Closing
The maximum priority of a thread is _____.
- 1
- 5
- 10
- none of the above
Exception occurs during _________.
- translation time
- compilation time
- run time
- none of the above
A J Menu Bar cannot be added directly to a ____.
- content pane
- form
- applet
- frame
If all the child threads are destroyed, the main thread will automatically be destroyed.
- True
- False
An event object implements which of the following methods?
- To String ()
- Get Source ()
- Get String ()
- None of the above
Abstract classes cannot be instantiated.
- True
- False
In Java, each integer variable occupies ________ byte(s) of memory.
- 2
- 4
- 6
- 1
The statement 'Color c = new Color (230, 260, 244)' is correct.
- True
- False
The ______ class is the super class of all the classes.
- base
- java. lang
- object
- system
________ class is used to store bit values.
- Byte Set
- Bit Sets
- Byte Sets
- Bit Set
The ____ layout stores the components in the form of a stack, one over the other.
- flow
- grid bag
- border
- card
The method 'skip ()' in java. io package takes ______ argument(s).
- two
- one
- four
- three
Assuming that 'MS-Windows' is created in Java, the 'Display' option of Control Panel must have been created using ________.
- Table
- Card Layout
- Tabbed Pane
- Scroll Pane
The method 'Read Line ()' returns ____ if no more data is available to read.
- 0
- 1
- -1
- null
The stream class 'File Input Stream' throws a/an ____ exception.
- IO
- File Not Found
- Class Not Found
- Interrupted
An applet must be a sub class of the 'Applet' class; the exception to this is J Applet.
- True
- False
The return value of the method 'execute Update (String s)' is _______.
- integer
- double
- record set
- no return value
The Mouse Listener contains ____ methods to trap mouse events.
- 2
- 4
- 6
- 5
To count the number of items in a List Box, the ____ method can be used.
- Get Count ()
- Get Items Count
- Items.Count ()
- Get Item Count ()
To partially implement an Interface, we can use an abstract keyword.
- True
- False
Observe the following statement (commas are used to separate the parts that are not a part of the standard code): <APPLET, class= no error , height= 200 , width= 300 ></applet>
Which part has an error?
- Part 1
- Part 2
- Part 3
- No Error
______ is the process of creating multiple methods with the same name.
- Overriding
- Multi threading
- Overloading
- Copying
The method 'region Matches' can take a maximum of ___ arguments.
- 2
- 5
- 4
- 7
The method ______ is used to determine whether a Text Field can accept modifications or not.
- allows Edit ()
- allows Write()
- is Writable ()
- is Editable ()
Which of the following is NOT a method of the 'Linked List' class?
- Add First ()
- Remove Last ()
- Remove At ()
- Add Last ()
All controls generate events except ____, which is a passive control.
- label
- check box group
- radio button
- scrollbar
Menu is a subclass of
- menu bar
- main menu
- menu list
- none of the above
To increase/decrease the space between a component and the container window, the ___ method can be called.
- Insets (int, int, int, int)
- Insets (int, int, int)
- Insets (int, int)
- Insets (int)
The keyword 'extends' is followed by a/an ____ name.
- interface
- child class
- base class
- listener
The _______ constructor displays the current date.
- Day ()
- Today ()
- Date ()
- Now ()
The method '_______' searches for the first occurrence of a character or substring.
- Index Of
- Search
- Find
- Locate
_____ is used to generate a series of elements one at a time.
- Vector
- Hash Table
- Stack
- Enumeration
To create a JT able, we must also create a ______.
- J Scroll Pane
- J Image Icon
- Content Pane
- None of the above
_____ is the simplest concrete subclass of 'container'.
- Scroll Pane
- Panel
- List
- Menu
Each Java program has one thread, which is the ______ thread.
- calling
- called
- main
- child
The first argument of the method 'drawstring ()' is of _____ type.
- character
- Boolean
- Integer
- String
In Java, to call the constructor of the base class from the child class, constructor use the ______ call.
- base ()
- parent ()
- super ()
- none of the above
Bill Gates wants your help in correcting the following error. Suggest the correct solution:
Statement -System. out. Print ln (s. sub Str (1,2));
Error - cannot resolve symbol method sub Str (int, int)
- Use sub string
- Use one argument
- Use sub str
- Use two arguments