Cracking the Java Coding Interview pdfdrive com


Question Difference between a Class and an Object ? (Core Java)


Download 1.48 Mb.
Pdf ko'rish
bet130/182
Sana02.05.2023
Hajmi1.48 Mb.
#1423275
1   ...   126   127   128   129   130   131   132   133   ...   182
Bog'liq
Cracking the Java Coding Interview ( PDFDrive )

Question Difference between a Class and an Object ? (Core Java)
Answer A
class is a definition or prototype whereas an object is an instance or living
representation of the prototype.
Question What is the difference between method overriding and
overloading? (Core Java)
Answer Overriding is a method with the same name
and arguments as in a parent, whereas overloading is the same method name but
different arguments.
Question What is a "stateless" protocol ? (Core Java)
Answer Without getting into lengthy debates, it is generally accepted that
protocols like HTTP are stateless i.e. there is no retention of state between a
transaction which is a single request response combination.
Question What is constructor chaining and how is it achieved in Java ?
(Core Java)
Answer A child object constructor always first needs to construct its parent
(which in turn calls its parent constructor.). In Java it is done via an implicit call
to the no-args constructor as the first statement.
Question What is passed by ref and what by value ? (Core Java)
Answer All
Java method arguments are passed by value. However, Java does manipulate
objects by reference, and all object variables themselves are references.
Question Can RMI and Corba based applications interact ? (RMI)
Answer
Yes they can. RMI is available with IIOP as the transport protocol instead of
JRMP.
Question You can create a String object as String str = "abc"; Why cant a
button object be created as Button bt = "abc";? Explain (Core Java)
Answer The main reason you cannot create a button by Button bt1= "abc"; is
because "abc" is a literal string (something slightly different than a String object,
by-the-way) and bt1 is a Button object. The only object in Java that can be
assigned a literal String is java.lang.String. Important to note that you are NOT


assigned a literal String is java.lang.String. Important to note that you are NOT
calling a java.lang.String constuctor when you type String s = "abc";

Download 1.48 Mb.

Do'stlaringiz bilan baham:
1   ...   126   127   128   129   130   131   132   133   ...   182




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