Core java interview Questions You'll Most Likely Be Asked (Second Edition)


Download 1.52 Mb.
Pdf ko'rish
bet12/171
Sana07.01.2023
Hajmi1.52 Mb.
#1081886
1   ...   8   9   10   11   12   13   14   15   ...   171
Bog'liq
Core JAVA Interview Questions Youll M...

Single Line Comment: Such a comment begins with two
forward slashes (//) and ends at the end of the line. The


b.
c.
019.
following code snippet demonstrates this:
int count; // This stores the number of objects
Multi Line Comment: This starts with /* and ends with */.
Anything between these two is treated as a comment and
ignored by the compiler. The following code snippet
demonstrates this:
/*
This for loop repeats a block of code 10 times
*/
for (int i=0; i < 10; i++) {
}
Documentation comment: Documentation comments are
comments that are used to generate documentation for the
code via the JavaDoc tool. They start with /** and end with */.
The following code demonstrates this:
/**
* Method that does something
* @param a
*/
public void myMethod (int a) {
}
Explain what is JVM, JRE and JDK.
Answer:
JDK stands for Java Development Kit. It consists of the tools and
libraries that are required to write and run a Java program. So, it
includes the Java compiler, JRE and other tools.


020.
JRE stands for the Java Runtime Environment. It consists of the
tools that are required to run a Java program. It is included with
the JDK but it can also be installed by itself. If the JRE is installed
by itself without the JDK, you will be able to run a Java program
but you will not be able to write and compile Java code. JRE
includes the JVM and some other libraries.
JVM stands for the Java Virtual Machine. Java code is compiled
into byte code. This byte code is executed within the JVM. So,
the JVM just provides an execution environment to execute code.

Download 1.52 Mb.

Do'stlaringiz bilan baham:
1   ...   8   9   10   11   12   13   14   15   ...   171




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