Java Placement Questions
Java Placement Questions
QUESTIONS
What is a JVM?
What is the difference between a JDK
and a JVM?
What is difference between Path and
Classpath?
Path and Classpath areoperating
systemlevel environment variables. Path
is used define where the system can find
the executables(.exe) files and classpath is
used to specify the location .class files.
What is Externalizable?
Externalizable is anInterfacethat extends Serializable
Interface. And sends data into Streams in Compressed
Format. It has two methods,writeExternal(ObjectOuput
out)andreadExternal(ObjectInput in)
Externalizable is an interface that enables you to define
custom rules and your own mechanism for serialization.
Serializable defines standard protocoland provides
serialization capabilities.
What is the Difference between JDK and JRE?
The JDK is the Java Development Kit. I.e., the JDK is bundle
of software that you can use to develop Java based software.
The JRE is the Java Runtime Environment. I.e., the JRE is an
implementation of the Java Virtual Machine which actually
executes Java programs.
Typically, each JDK contains one (or more) JREs along with
the various development tools like the Java source compilers,
bundling and deployment tools, debuggers, development
libraries, etc.
classTestMemberOuter1{
privateintdata=30;
classInner{
voidmsg()
{System.out.println("datais"+data);}
}
publicstaticvoidmain(Stringargs[]){
TestMemberOuter1obj=newTestMemberOuter1(
);
TestMemberOuter1.Innerin=obj.newInner();
in.msg();
}
}
Output:
data is 30