E.M.G.
YADAVA WOMEN’S COLLEGE, MADURAI –
625 014.
(An Autonomous Institution – Affiliated to Madurai Kamaraj University)
Re-accredited (3rd Cycle) with Grade A+ & CGPA 3.51
by NAAC
DEPARTMENT OF BCA
Title of the paper: Core - Programming in Java
Subject code : : 23OUCA41
Semester : IV
Class : II Year
ONE MARK QUESTIONS AND ANSWERS
Choose the best answer:
1. _____is a mechanism where in a new class is derived from an existing class.(K1)
(a)Polymorphism (b) Encapsulation (c) Object (d) Inheritance
Ans: (d) Inheritance
2. The java ________ is used for the execution of the source code. (K2)
(a)Interpreter (b) Compiler (c) Assembler (d) Byte Code
Ans: (a) Interpreter
3. Java is a programming language developed by _________.(K1)
(a) Macintosh (b) apple (c) Sun Microsystems (d) Google
Ans: (c) Sun Microsystems
4. Every java application program must include the _________ method. (K1)
(a) void () (b) main () (c) float () (d) long ()
Ans: (b) main ()
5. ________ refers to a sequence of digits. (K2)
(a)Single Character Constant (b) String Constant
(c) Integer Constant (d) Real Constant
Ans: (c) Integer Constant
6. _______ is a sequence of characters enclosed between double quotes. (K2)
(a) Operator (b) String Constant
(c) Conditional (d) Assignment
Ans: (b) String Constant
7. ________ Combines two or more relational expression. (K2)
(a) Logical expression (b) Character type
(c) Floating Point type (d) Integer types.
Ans: (a) Logical expression
8.________are used to construct mathematical expression as algebra. (K2)
(a) Arithmetic operators (b) Relational operators
(c) Logical operators (d) Assignment operators.
Ans: (a) Arithmetic operators
9. Which identifier that denotes a storage location used to store a data value? (K1)
(a)Variable (b) Data (c) Constant (d) Value
Ans: (a) Variable
10. Which of the following can be operands of arithmetic operator? (K1)
(a) Numeric (b) Boolean (c) Character (d) Both Boolean & Characters
Ans :( d) Both Boolean & Characters
11. Modulus operator (%) can be applied to_______.(K2)
(a) Integer (b) Float (c) Both Integers & Floating point (d) Character type
Ans: (d) Character type
12. Which statement is used in the multipath decision? (K1)
(a) Else-if (b) for (c) if-else (d) switch
Ans: (a) Else-if
13. The do-while loop repeats the set of code at least ________ before
the condition is tested. (K1)
(a) Once (b) twice (c) thrice (d) fours
Ans: (a) once
14. Which keyword halts the execution of the current loop and force control out of
the loop. (K1)
(a) break (b) switch (c) continue (d) goto
Ans: (d) goto
15. Array subscripts starts with ___________.(K2)
(a) zero (b) one (c) two (d) three.
Ans: (a) zero
16. Constructor method is used to initialize an object when it is declared. This
process is known as ___________.(K1)
(a) Finalizer (b) abstract (c) Overriding (d) Initialization
Ans: (d) Initialization
17._______are also called nested classes. (K2)
(a) Inner classes (b) outer classes
(c) Classes (d) static nested classes
Ans: (a) Inner classes
18.________can be overloaded like regular methods. (K2)
(a) Constructors (b) Finalizer
(c) Constructor and Finalizer (d) Abstract methods
Ans: (a) Constructors
19. Methods with same name but different argument list are called ______
methods. (K2)
(a)Overloaded (b) Overriding (c) Inheritance (d) Multithreaded
Ans: (a) Overloaded
20. Which method is used in Java to free resources? (K1)
(a) destructor() (b) finalize() (c) abstract() (d) free()
Ans: (b) finalize()
21. ______ is an group of contiguous or related common name (K1)
(a) Array (b) String (c) Vector (d) Wrapper Class
Ans: (a) Array
22. _______ can be used to store a list of objects that may vary in size. (K1)
(a) Array (b) String (c) Vector (d) Wrapper Class
Ans: (c) Vector
23. Java makes use of Vector class contained in the______package. (K1)
(a) java.util (b) java.lang (c) java.math (d) java.io
Ans: (a) java.util
24. Java interfaces are designed to support ______ method resolution at a
run time. (K2)
(a) Fixed (b) Dynamic (c) Static (d) fixed value
Ans: (b) Dynamic
25. Packages contain a set of classes in order to ensure that class names are
________. (K2)
(a) Unique (b) Different (c) Same (d) Valid
Ans: (a) Unique
26.A_______ can be used to store a list of objects that may vary in size. (K2)
(a) Vector (b) Object references (c) Primitive data type (d) Primitive
Ans: (a) Vector
27. Which of those keywords can be used to prevent method overriding? (K1)
(a) Static (b) Constant (c) protected (d) Final
Ans: (d) Final
28.______ provides a large number of classes grouped into different packages
according to functionality. (K2)
(a) java.util (b) java.io (c) Java API (d) java.awt
Ans : (c) Java API
29. Which class that is to be put in the package & declare it_____ . (K1)
(a) private (b) public (c) protected (d) static
Ans: (b) public
30. Interface are used as_______ whose properties are inherited by class. (K2)
(a) constant (b) subclass (c) extend (d) super class
Ans: (d) super class
31. An exception is an _________ condition that arise in a code sequence
at run time. (K2)
(a) neutral (b) abnormal (c) normal (d) valid
Ans: (b) abnormal
32. Identify which one is an example for lightweight process. (K1)
(a) Thread (b) process (c) JVM (d) multi-thread
Ans: (a) Thread
33. _________ catch statements for _________ try block. (K2)
(a) one,one (b) two,one (c) multiple,one (d) multiple,two
Ans: (c) multiple,one
34._______ are the wrongs that can make a program go wrong (K2)
(a)Errors (b) interface (c) inheritance (d) multithread
Ans: (a) Errors
35. A thread can have a maximum priority of ___________. (K2)
(a) 1 (b) 10 (c) 5 (d) 2
Ans: (b) 10
36. The ______ method is the heart and soul of any thread. (K2)
(a) start () (b) run() (c) thread (d) java
Ans: (b) run ()
37. Identify Which one of these is a super class of all exceptional type class? (K1)
(a) String (b) Runtime exception (c) Throwable (d) Catchable
Ans: (c) Throwable
38. Which Exception classes are available in the _______package. (K1)
(a) java.lang (b) java.awt
(c) java.io (d) java .applet
Ans: (a) java.lang
39. Find out which one is related to hit the exception ?(K1)
(a) Find the problem (b) Inform that an error has occurred
(c)Receive the error information (d) Take corrective actions
Ans: (a) Find the problem
40. Which exception is thrown by read ( ) method? (K1)
(a) IOException (b) Interrupted Exception
(c) System Exception (d) System Input exception
Ans: (a) IO Exception
41. Which of these methods can be used to output a string in an applet? (K1)
(a) display (b) print()
(c) drawString() (d) transient()
Ans: (c) drawString()
42. An _________ extracts data from the stream. (K2)
(a) input stream (b) output stream (c) instream (d) outstream
Ans: (a) input stream
43. Which of these classes are used by character streams output operations? (K1)
(a) input stream (b) writer
(c) read stream (d) input/output stream
Ans: (b) writer
44. Which of these classes is used to create an object whose character sequence is
mutable? (K1)
(a) string (b) string buffer() (c) write() (d) read()
Ans: (b) string buffer()
45. The ______ class implements a single-line text-entry area, usually
called an edit control. (K2)
(a) TextComponent (b) setText (c) getText (d) TextField
Ans: (d)TextField
46. The Applet address on the web, this address is known as ______. (K2)
(a) Uniform Resource Locator (b) Applet tag (c) ULR (d) Applet
Ans: (a) Uniform Resource Locator
47. Which method is called only once during the run time of your applet? (K1)
(a) stop () (b) init() (c) paint() (d) destroy()
Ans: (b) init()
48. ____________ is trigged when a text field is modified. (K2)
(a) ItemEvent (b) EventText (c) TextEvent (d) KeyEvent
Ans: (c)TextEvent
49. What is used to run an applet ? (K1)
(a) html file (b) php file (c) An applet viewer tool (d) http file
Ans: (c) An applet viewer tool
50. Concatenation of files is achieved using __________ class. (K2)
(a) SequenceInputStream (b) SequenceStream
(c) SequenceOutputStream (d) byte stream
Ans: (a) SequenceInputStream