Cracking the Java Coding Interview pdfdrive com


Question What is the difference between a while statement


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

Question What is the difference between a while statement


and a do statement? (Core Java)
Answer A while statement checks at the beginning of a loop to see whether the
next loop iteration should occur. A do statement checks at the end of a loop to
see whether the next iteration of a loop should occur. The do statement will
always execute the body of a loop at least once.
Question What modifiers can be used with a local inner class? (Core Java)
Answer A local inner class may be final or abstract.
Question What is the purpose of the File class? (Core Java)
Answer The File
class is used to create objects that provide access to the files and directories of a
local file system.
Question Can an exception be rethrown? (Core Java)
Answer Yes, an
exception can be rethrown.
Question When does the compiler supply a default constructor for a class?
(Core Java)
Answer The compiler supplies a default constructor for a class if no
other constructors are provided.
Question If a method is declared as protected, where may the method be
accessed? (Core Java)
Answer A protected method may only be accessed by classes or interfaces of the
same package or by subclasses of the class in which it is declared.
Question Which non-Unicode letter characters may be used as the first
character of an identifier? (Core Java)
Answer The non-Unicode letter characters $ and _ may appear as the first
character of an identifier.
Question What restrictions are placed on method overloading? (Core Java)
Answer Two methods may not have the same name and argument list but
different return types.
Question What is casting? (Core Java)
Answer There are two types of casting, casting between primitive numeric types
and casting between object references. Casting between numeric types is used to
convert larger values, such as double values, to smaller values, such as byte
values. Casting between object references is used to refer to an object by a
compatible class, interface, or array type reference.

Download 1.48 Mb.

Do'stlaringiz bilan baham:
1   ...   96   97   98   99   100   101   102   103   ...   182




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