Cracking the Java Coding Interview pdfdrive com


Question What does the "final" keyword mean in front of a variable? A


Download 1.48 Mb.
Pdf ko'rish
bet117/182
Sana02.05.2023
Hajmi1.48 Mb.
#1423275
1   ...   113   114   115   116   117   118   119   120   ...   182
Bog'liq
Cracking the Java Coding Interview ( PDFDrive )

Question What does the "final" keyword mean in front of a variable? A
method? A class? (Core Java)
Answer FINAL for a variable : value is constant. FINAL for a method : cannot
be overridden. FINAL for a class : cannot be derived .
Question What is the difference between instanceof and isInstance? (Core
Java)
Answer instanceof is used to check to see if an object can be cast into a specified
type without throwing a cast class exception. isInstance() Determines if the
specified Object is assignmentcompatible with the object represented by this
Class. This method is the dynamic equivalent of the Java language instanceof
operator. The method returns true if the specified Object argument is non-null
and can be cast to the reference type represented by this Class object without
raising a ClassCastException. It returns false otherwise.
Question Why does it take so much time to access an Applet having Swing
Components the first time? (Swing)
Answer Because behind every swing component are many Java objects and
resources. This takes time to create them in memory. JDK 1.3 from Sun has
some improvements which may lead to faster execution of Swing applications.
Question How do I include static files within a JSP page? (JSP)
Answer Static resources should always be included using the JSP include
directive. This way, the inclusion is performed just once during the translation
phase. The following example shows the syntax: Do note that you should always
supply a relative URL for the file attribute. Although you can also include static
resources using the action, this is not advisable as the inclusion is then
performed for each and every request.
Question Why does JComponent have add() and remove() methods but
Component does not? (Swing)


Answer because JComponent is a subclass of Container, and can contain other
components and jcomponents.

Download 1.48 Mb.

Do'stlaringiz bilan baham:
1   ...   113   114   115   116   117   118   119   120   ...   182




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