Cracking the Java Coding Interview pdfdrive com


Question What must a class do to implement an interface? (Core Java)


Download 1.48 Mb.
Pdf ko'rish
bet97/182
Sana02.05.2023
Hajmi1.48 Mb.
#1423275
1   ...   93   94   95   96   97   98   99   100   ...   182
Bog'liq
Cracking the Java Coding Interview ( PDFDrive )

Question What must a class do to implement an interface? (Core Java)
Answer It must provide all of the methods in the interface and identify the
interface in its implements clause.
Question What is the advantage of the eventdelegation model over the
earlier eventinheritance model? (Core Java)
Answer The eventdelegation model has two advantages over the
eventinheritance model. First, it enables event handling to be handled by objects
other than the ones that generate the events (or their containers). This allows a
clean separation between a component's design and its use. The other advantage
of the eventdelegation model is that it performs much better in applications
where many events are generated. This performance improvement is due to the
fact that the eventdelegation model does not have to repeatedly process
unhandled events, as is the case of the eventinheritance model.
Question How are commas used in the intialization and iteration parts of a


for statement? (Core Java)
Answer Commas are used to separate multiple statements within the
initialization and iteration parts of a for statement.
Question What is an abstract method? (Core Java)
Answer An abstract
method is a method whose implementation is deferred to a subclass.
Question What value does read() return when it has reached the end of a
file? (Core Java)
Answer The read() method returns -1 when it has reached the
end of a file.
Question Can a Byte object be cast to a double value? (Core Java)
Answer
No, an object cannot be cast to a primitive value.
Question What is the difference between a static and a nonstatic inner
class? (Core Java)
Answer A nonstatic inner class may have object instances that are associated
with instances of the class's outer class. A static inner class does not have any
object instances.

Download 1.48 Mb.

Do'stlaringiz bilan baham:
1   ...   93   94   95   96   97   98   99   100   ...   182




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling