| Back to Questions Page |
| |
| Question |
What do you mean by the term transient? |
Rank |
Answer Posted By |
|
Question Submitted By :: Manoj Pandey |
| This Interview Question Asked @ Ericsson |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | Transient are those things which are not stored in
database...  |
| Sayantan Biswas |
| |
| |
| Answer | Transient is a keyword used for class level variables.
Serialisation of that variable can be avoided by declaring
it transient.  |
| Jesudian Moses |
| |
| |
| Answer | transient is a variable that may not be serialized.  |
| Guest |
| |
| |
|
|
| |
| Answer | transient is the modifer for varibles.if declared variable
with transient its never pariticaptes variable in
serialization process.
most of this case used for banking application for passwords
ex:transient long password;  |
| Paletipatisrinu |
| |
| |
| Question |
Can we instantiate Interfaces? |
Rank |
Answer Posted By |
|
Question Submitted By :: Manoj Pandey |
| This Interview Question Asked @ Ericsson |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | No we can instantiate interface directly.but we can create
instantiate of interface in directly
interface i1
{
public void wish();
}
public class A implements i1
{
public static void main(string...arg)
{
i1 o1=new A();
o1.wish();
}
public void wish()
{
System.out.println("we can create instantiate in directly");
}
}  |
| Paletipatisrinu |
| |
| |
| Answer | no we can not.  |
| Guest |
| |
| |
| Answer | answer no 1. is correct programatically but actually
instantiates means obtain the behavier of object we can do
this only by creating object of class ,object has state and
behaviour, in answer 1,we transfer state first and then
write behaviour in the class,then instantiate that class ie
like dynamic method dispatch.means therotically we can not
instantiate Interfaces  |
| Dhawal |
| |
| |
| Answer | You can only create a reference of an interface but cannot
instantiate.  |
| Divya |
| |
| |
| Question |
Which of these methods belong to Thread & Object class?
join, yield, sleep, wait, notify |
Rank |
Answer Posted By |
|
Question Submitted By :: Manoj Pandey |
| This Interview Question Asked @ Ericsson |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | wait()and notify() methods are Thread and object class methods  |
| Paletipatisrinu |
| |
| |
| Answer | methods inherited from java.lang.Object
*clone
*equals
*finalize
*getClass
*hashCode
*notify
*notifyAll
*wait
and this three methods join, yield, sleep belongs to Threads
class  |
| Vikki |
| |
| |
| Question |
What is the diff. b/w Interfaces & Abstract class? |
Rank |
Answer Posted By |
|
Question Submitted By :: Manoj Pandey |
| This Interview Question Asked @ Ericsson |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | interface contain purely undefined methods but abstract
class contain purely defined methods and undefined methods.  |
| Paletipatisrinu |
| |
| |
| Answer | Interfaces are implictly public and abstract and abstract
classes have abstract and non abstract methods  |
| Parminder |
| |
| |
| Answer | empty body of in interface doesn't have any type of defined
item's but in abstract class having defined body that is
constructor  |
| Poornachandra |
| |
| |
| Answer | in java interface having a method name its not implemented
by methods it is default abstract class not mentiond the
abstract key word
but abstract class compulosory mentioned the abstract key
word but in this abstrct class concreat methods concreat
methods means some methods are implemented some methods are
not implemented
 |
| Poorna Chandar Rao.yerrabothu |
| |
| |
| Question |
What is "Java Native Interface" and how to use it? |
Rank |
Answer Posted By |
|
Question Submitted By :: Madhusudan |
| This Interview Question Asked @ IBM |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | The Java Native Interface (JNI) is the native programming
interface for Java that is part of the JDK. By writing
programs using the JNI, you ensure that your code is
completely portable across all platforms. It allows Java
code that runs within a Java Virtual Machine (VM) to
operate with applications and libraries written in other
languages, such as C, C++, and assembly.  |
| Shilpi Agarwal |
| |
| |
| Question |
where lives in jvm |
Rank |
Answer Posted By |
|
Question Submitted By :: Viji124 |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | JVM lives in the topmost layer of the Operating System.  |
| Ajay Yadav |
| |
| |
| Answer | in processor  |
| Poorna Chandar Rao.yerrabothu |
| |
| |
| Answer | JVM lives on Topmost layer operating system.every operting
system contain its own JVM  |
| Srinu |
| |
| |
| Question |
what is unreachable code problem in multiple catch statements |
Rank |
Answer Posted By |
|
Question Submitted By :: Shivakrishna |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | if v just gve a default exception block,bfre the specific
catch statement it ll create a unreachable code exception
e.g
catch(Exception e)
{System.out.println(unknown exception);}
catch(ArithmeticException e)
{System.out.println("Division by zero");}  |
| Deepthi |
| |
| |
| Answer | Subclass exception handler should come first then the
superclass has to come next. Then only code wil compile
otherwise subclass exception will be never reached results
compilation error.  |
| Sriragv [Aizza] |
| |
| |
| Question |
we have two threads..both the threads are reading the
data.. is there any need of synchronization
there?...justify it? |
Rank |
Answer Posted By |
|
Question Submitted By :: Murali |
| This Interview Question Asked @ IBM |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | synchronization is necessary in threads
problem.synchronization means at a time only one thread can
access it.If it is not done then one thread will read the
resource & other will try to update it.It will create a
problem.  |
| Ranjan |
| |
| |
| Answer | It depends upon the data.
where the data is chngable by threads at that time we need
to apply the synchronization.
if the data is purly static data no need to protect the
databy using synchronization. why because if we apply
(synchronization) each and every time there is a
performance degradation is there.
Time factor(it will take more time)  |
| Ysr |
| |
| |
| Answer | sychronization is used to execute only one thread or one
block ata time.if your not declare sychronized in the method
there is chance to execute the mixed data i.e.; to threads
start at atime.  |
| Babu |
| |
| |
| Answer | In this case synchronization is not requied because u r not
going to change the data.
U can use synchronization but performence will decrease.  |
| Sridhar |
| |
| |
| Question |
what is j2se |
Rank |
Answer Posted By |
|
Question Submitted By :: Abc |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | J2SE- Java 2 standard edition:
A development platform for desktop applications.  |
| Orenise |
| |
| |
| Answer | it is a java based application platform.  |
| Ramesh Rao |
| |
| |
| Answer | it is only desktop programming  |
| Poorna Chandar Rao.yerrabothu |
| |
| |
| Question |
how can we import the user defined package without classpath?
|
Rank |
Answer Posted By |
|
Question Submitted By :: E Shiva Prasad |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | create jar file for your class and place under jre ext
folder  |
| Anand |
| |
| |
| Question |
what is meant by UP& DOWN casting in java? |
Rank |
Answer Posted By |
|
Question Submitted By :: Murali |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | Casting is the process of converting one data type in to
another.Converting smaller data type into higher data type
is known as up casting.Where as the process of converting
higher data type to lower is known as down casting.  |
| Paritala.veeraiah Chowdary |
| |
| |
| Answer | i think.. UPcasting is converting one type to another
without any loss of data... and DOWNcasting is converting
one type to another with loss of data  |
| Jack |
| |
| |
| Answer | Down Casting is nothing but casting down the inheritance
tree to a more specific class i.e casting a superclass to
subclass.
Upcasting- casting up the inheritance tree to a more general
type. It is done implicitly (i.e typing in the cast is not
required). Its because the classes at lower level of
hierarchy have all those features that are present in the
classes above them in the inheritance hierarchy. So they can
be upcasted implicitly ( like Dog IS-A Animal).
I got this answer
from(http://javaforyou.wordpress.com/2008/06/22/casting-reference-variables-downcasting-upcasting/)
with example.  |
| Sabeetha |
| |
| |
| Answer | Casting is nothing but data type conversion.
Up casting is the conversion of data type from lower range data type to higher data type eg: int to long, byte to long, int to double etc...
Down casting is vice versa of up casting, here we do type casting from larger value to lower value,
eg: double to byte, long to int etc  |
| Javachi |
| |
| |
| Question |
suppose in a class there is a code like this:
{
Set hs=new Hashset();
hs.add(new Emp("kathy",1000));
hs.add(new Emp("kathy",2000));
}
how can u avoid the above code in your class as set won't
allow duplicate objects? |
Rank |
Answer Posted By |
|
Question Submitted By :: Murali |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | This can achieved by overriding equals and hashCode method  |
| Harish |
| |
| |
| Answer | by implementing equals and toHashCode method in emp Class  |
| Mushtaq Hussain |
| |
| |
|
| |
|
Back to Questions Page |