| Back to Questions Page |
| |
| Question |
What is the difference between the >> and >>> operators? |
Rank |
Answer Posted By |
|
Question Submitted By :: Guest |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | The >> operator carries the sign bit when shifting right.
The >>> zero-fills bits that have been shifted out.  |
| Shweta |
| |
| |
| Question |
What is the difference between static and non-static
variables? |
Rank |
Answer Posted By |
|
Question Submitted By :: Guest |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | Static variables:
There is only one copy of static variable and even
when the class is instatiated, the value remains the same.
Non-static variables:
Every time the class is instatiated, the objest has
their own copy of these variables.  |
| Sathya |
| |
| |
| Answer | static variables are class variables and the values remains
same fr the whole class
nonstatic variables are of two kinds
global variables:are the variables which defines variables
which can be accesible over the whole class
local variables:the scope of local variables is with tin
the method only  |
| Ravikiran |
| |
| |
|
|
| |
| Question |
What is the frontend and backedn in Java? |
Rank |
Answer Posted By |
|
Question Submitted By :: Guest |
| This Interview Question Asked @ TCS |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | front end means which u going to have look and feel like
jsp,swings,awt pakage
back end menas which is going to implement the business
logic for you  |
| Narasimha |
| |
| |
| Answer | front end is html or UI elements
back end is the database or persistent storage  |
| Ravikiran |
| |
| |
| Question |
What is yielding and sleeping? how they different? |
Rank |
Answer Posted By |
|
Question Submitted By :: Guest |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | When a thread yields, its execution is paused and loses
ownership of the monitor lock giving other waiting threads a
chance to run.
When a thread sleeps, its execution is paused for the
specified duration during such an idle period, the thread
continues to retain the ownership of the monitor lock.  |
| Ranganathkini |
| |
| |
| Answer | yield() method will suspend all the same priority thread
which is running and gives chance to next thread to run
which is of the same priority
sleep() method will make the thread to sleep for a
particular period of time which is specified in the
argument list  |
| Ravikiran |
| |
| |
| Question |
What is the difference between throw and throws? |
Rank |
Answer Posted By |
|
Question Submitted By :: Guest |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | The 'throw' statement initiates an exception to be thrown
where as the 'throws' clause declares that the method is
expected to throw 1 or more checked execptions.  |
| Ranganathkini |
| |
| |
| Answer | 'throw' exception is thrown manually and 'throws' exception
is thrown predefindly.  |
| Sushma |
| |
| |
| Answer | throw will declare an exception
throws will throw the exception to the calling method  |
| Ravikiran |
| |
| |
| Answer | By Using throw , we can create our own exceptions or user
defined exceptions and we can thorw , where as throws
defines the list of exceptions to be thown by the method.  |
| Swapna Kumari Arava |
| |
| |
| Answer | 'throw' is declare the exception and throws is defined the
exception  |
| Rajanani |
| |
| |
| Question |
Difference between prefix and postfix forms of the
++operator? |
Rank |
Answer Posted By |
|
Question Submitted By :: Guest |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | The prefix ++ operator first increments the value by one and
then returns the new value.
The postfix ++ operator first returns the value and then
increments it.  |
| Ranganathkini |
| |
| |
| Answer | prefix will increment first and assigns to the variable
postfix will assing the value to the variable and then
increments  |
| Ravikiran |
| |
| |
| Question |
Difference between the paint() and repaint() methods? |
Rank |
Answer Posted By |
|
Question Submitted By :: Guest |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | The paint method causes the component and and all its parts
to be painted on the Graphics context tat is passed in as
parameter.
If the component is a light-weight component, then a call to
the component's repaint method which invokes the paint
method as soon as possible. If the component is not a
light-weight component, then calling repaint is the same as
calling the update method.  |
| Ranganathkini |
| |
| |
| Question |
Difference between the String and StringBuffer classes? |
Rank |
Answer Posted By |
|
Question Submitted By :: Guest |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | String class is immutable i.e oncle created the value
cannot chage.
Stringbuffer class is mutable.The value can change.  |
| Sathya |
| |
| |
| Answer | yes, String is a immutable that means once the string
object is created it cannot be changed.
String Buffer: it is a mutable,this object is changed if we
make any modifications.  |
| Anitha |
| |
| |
| Answer | String is immutable and StringBuffer is mutable as most of
we know. In performance, StringBuffer is faster than the
String while performing simple concatenations.  |
| Latha |
| |
| |
| Question |
In which JDK version event-delegation model is introduced? |
Rank |
Answer Posted By |
|
Question Submitted By :: Guest |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | JDK 1.1  |
| Ranganathkini |
| |
| |
| Question |
What are Font and FontMetrics classes? |
Rank |
Answer Posted By |
|
Question Submitted By :: Guest |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | The Font class provides mappings to fonts that are used to
render text data onto the screen. The Font class maps the
characters of the language to their respecitve glyphs.
The FontMetrics provides access to attributes of Font
objects, things such as char width, char height, ascents,
line spacing, etc, all of which help in drawing the fonts on
the screen.  |
| Ranganathkini |
| |
| |
| Question |
What are File and RandomAccessFile classes? |
Rank |
Answer Posted By |
|
Question Submitted By :: Guest |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | The java.io.File is represents a filepath and provides
methods to access filesystem services in the Java
application. Services such as creating folders, verifying
the existance or permissions of a file, etc.
The java.io.RandomAccessFile is a class that allows random
record based access to data stored in a file. This class
helps in creating and manipulating files in a record based
way unlike a sequential access provided by streams.  |
| Ranganathkini |
| |
| |
| Question |
Explain the difference between the Boolean & operator and
the && operator? |
Rank |
Answer Posted By |
|
Question Submitted By :: Guest |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | This can be explained with an example
1. The bitwise AND operator ( & )
(boolean expression1) & (boolean expression2)
to evaluate the above expression, Java first evaluates both
boolean expression1 and boolean expression2
hence only if both boolean expression1 and boolean
expression2 evaluate to true, the whole expression evaluates
to true.
2. The conditional AND operator ( && )
( boolean expression1 ) && ( boolean expression2 )
Here Java first evaluates boolean expression1, only if it
evaluates to true, boolean expression2 is evaluated. Hence
boolean expression2 is not evaluated if boolean expression1
evaluates to false.
The conditional AND operator, sometimes called the
short-circuit operator is more efficient that the bitwise
AND operator. As it saves the processing of expression2 by
first evaluating expression1 and ascertaining that the final
result will be false.  |
| Ranganathkini |
| |
| |
|
| |
|
Back to Questions Page |