Deck 10: Java Programming Language: Inheritance, Interfaces, Packages, and Methods

Full screen (f)
exit full mode
Question
Which of these is correct way of inheriting class A by class B?

A)class B + class A {}
B)class B inherits class A {}
C)class B extends A {}
D)class B extends class A {}
Use Space or
up arrow
down arrow
to flip the card.
Question
Which of the following are true about interfaces.

A)Methods declared in interfaces are implicitly private.
B)Variables declared in interfaces are implicitly public, static, and final.
C)An interface contains any number of method definitions.
D)The keyword implements indicate that an interface inherits from another.
Question
Which of the following is correct way of implementing an interface salary by class manager?

A)class Manager extends salary {}
B)class Manager implements salary {}
C)class Manager imports salary {}
D)None of the mentioned.
Question
Which of the following is incorrect statement about packages?

A)Package defines a namespace in which classes are stored.
B)A package can contain other package within it.
C)Java uses file system directories to store packages.
D)A package can be renamed without renaming the directory in which the classes are stored.
Question
Which exception is thrown by read() method?

A)IOException
B)InterruptedException
C)SystemException
D)SystemInputException
Question
Which method in Thread class is used to check weather a thread is still running?

A)isAlive()
B)Join()
C)isRunning()
D)Alive()
Question
Which of these class contains the methods print() & println()?

A)System
B)System.out
C)BufferedOutputStream
D)PrintStream
Question
To design a general-purpose search method, searchList, to search a list, which of the following must be parameters of the method searchList?
(i) The array containing the list.
(ii) The length of the list.
(iii) The search item.
(iv) A boolean variable indicating whether the search is successful.

A)(i) and (ii)
B)(i), (ii), and (iii)
C)(ii), (iii), and (iv)
D)(i), (ii), (iii), and (iv)
Question
In which package is the class Vector located?

A)java.io
B)java.lang
C)java.util
D)java.text
Question
For the interface WindowListener that contains more than one method, Java provides the class ____.

A)MouseAdapter
B)WindowAdapter
C)KeyListener
D)KeyAdapter
Question
Consider the following list. int[] intList = {35, 12, 27, 18, 45, 16, 38}; What is the minimum number of comparisons that have to be made to find 18 using a sequential search on intList?

A)1
B)2
C)3
D)4
Question
Which of these packages contains all the classes and methods required for even handling in Java?

A)java.applet
B)java.awt
C)java.event
D)java.awt.event
Question
What is an event in delegation event model used by Java programming language?

A)An event is an object that describes a state change in a source.
B)An event is an object that describes a state change in processing.
C)An event is an object that describes any change by the user and system.
D)An event is a class used for defining object, to create events.
Question
Which of these methods are used to register a keyboard event listener?

A)KeyListener()
B)addKistener()
C)addKeyListener()
D)eventKeyboardListener()
Question
Which of these methods are used to register a mouse motion listener?

A)addMouse()
B)addMouseListener()
C)addMouseMotionListner()
D)eventMouseMotionListener()
Question
What is a listener in context to event handling?

A)A listener is a variable that is notified when an event occurs.
B)A listener is a object that is notified when an event occurs.
C)A listener is a method that is notified when an event occurs.
D)None of the mentioned
Question
Which command disassembles a class file

A)javaamd
B)javacmd
C)java
D)javap
Question
Which of the following statements is false as far as different type of statements is concern in JDBC?

A)Regular Statement
B)Prepared Statement
C)Callable Statement
D)Interim Statement
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/18
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 10: Java Programming Language: Inheritance, Interfaces, Packages, and Methods
1
Which of these is correct way of inheriting class A by class B?

A)class B + class A {}
B)class B inherits class A {}
C)class B extends A {}
D)class B extends class A {}
class B extends A {}
2
Which of the following are true about interfaces.

A)Methods declared in interfaces are implicitly private.
B)Variables declared in interfaces are implicitly public, static, and final.
C)An interface contains any number of method definitions.
D)The keyword implements indicate that an interface inherits from another.
Variables declared in interfaces are implicitly public, static, and final.
3
Which of the following is correct way of implementing an interface salary by class manager?

A)class Manager extends salary {}
B)class Manager implements salary {}
C)class Manager imports salary {}
D)None of the mentioned.
class Manager implements salary {}
4
Which of the following is incorrect statement about packages?

A)Package defines a namespace in which classes are stored.
B)A package can contain other package within it.
C)Java uses file system directories to store packages.
D)A package can be renamed without renaming the directory in which the classes are stored.
Unlock Deck
Unlock for access to all 18 flashcards in this deck.
Unlock Deck
k this deck
5
Which exception is thrown by read() method?

A)IOException
B)InterruptedException
C)SystemException
D)SystemInputException
Unlock Deck
Unlock for access to all 18 flashcards in this deck.
Unlock Deck
k this deck
6
Which method in Thread class is used to check weather a thread is still running?

A)isAlive()
B)Join()
C)isRunning()
D)Alive()
Unlock Deck
Unlock for access to all 18 flashcards in this deck.
Unlock Deck
k this deck
7
Which of these class contains the methods print() & println()?

A)System
B)System.out
C)BufferedOutputStream
D)PrintStream
Unlock Deck
Unlock for access to all 18 flashcards in this deck.
Unlock Deck
k this deck
8
To design a general-purpose search method, searchList, to search a list, which of the following must be parameters of the method searchList?
(i) The array containing the list.
(ii) The length of the list.
(iii) The search item.
(iv) A boolean variable indicating whether the search is successful.

A)(i) and (ii)
B)(i), (ii), and (iii)
C)(ii), (iii), and (iv)
D)(i), (ii), (iii), and (iv)
Unlock Deck
Unlock for access to all 18 flashcards in this deck.
Unlock Deck
k this deck
9
In which package is the class Vector located?

A)java.io
B)java.lang
C)java.util
D)java.text
Unlock Deck
Unlock for access to all 18 flashcards in this deck.
Unlock Deck
k this deck
10
For the interface WindowListener that contains more than one method, Java provides the class ____.

A)MouseAdapter
B)WindowAdapter
C)KeyListener
D)KeyAdapter
Unlock Deck
Unlock for access to all 18 flashcards in this deck.
Unlock Deck
k this deck
11
Consider the following list. int[] intList = {35, 12, 27, 18, 45, 16, 38}; What is the minimum number of comparisons that have to be made to find 18 using a sequential search on intList?

A)1
B)2
C)3
D)4
Unlock Deck
Unlock for access to all 18 flashcards in this deck.
Unlock Deck
k this deck
12
Which of these packages contains all the classes and methods required for even handling in Java?

A)java.applet
B)java.awt
C)java.event
D)java.awt.event
Unlock Deck
Unlock for access to all 18 flashcards in this deck.
Unlock Deck
k this deck
13
What is an event in delegation event model used by Java programming language?

A)An event is an object that describes a state change in a source.
B)An event is an object that describes a state change in processing.
C)An event is an object that describes any change by the user and system.
D)An event is a class used for defining object, to create events.
Unlock Deck
Unlock for access to all 18 flashcards in this deck.
Unlock Deck
k this deck
14
Which of these methods are used to register a keyboard event listener?

A)KeyListener()
B)addKistener()
C)addKeyListener()
D)eventKeyboardListener()
Unlock Deck
Unlock for access to all 18 flashcards in this deck.
Unlock Deck
k this deck
15
Which of these methods are used to register a mouse motion listener?

A)addMouse()
B)addMouseListener()
C)addMouseMotionListner()
D)eventMouseMotionListener()
Unlock Deck
Unlock for access to all 18 flashcards in this deck.
Unlock Deck
k this deck
16
What is a listener in context to event handling?

A)A listener is a variable that is notified when an event occurs.
B)A listener is a object that is notified when an event occurs.
C)A listener is a method that is notified when an event occurs.
D)None of the mentioned
Unlock Deck
Unlock for access to all 18 flashcards in this deck.
Unlock Deck
k this deck
17
Which command disassembles a class file

A)javaamd
B)javacmd
C)java
D)javap
Unlock Deck
Unlock for access to all 18 flashcards in this deck.
Unlock Deck
k this deck
18
Which of the following statements is false as far as different type of statements is concern in JDBC?

A)Regular Statement
B)Prepared Statement
C)Callable Statement
D)Interim Statement
Unlock Deck
Unlock for access to all 18 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 18 flashcards in this deck.