java Flashcards

1
Q

We will go with some terminology

A

In Java when we write code, you will make a source code file which has .java extension, compile it using the javac compiler, and then run the compiled bytecode on a Java virtual machine.
After the Java code is compiled, the bytecode gets generated, which can be executed on any machine using JVM.
When you compile, java actually looks for syntax error so until you have the right syntax, the program will not run.
Bytecode is the .class file.

This is why Java is platform independent because you can run the bytecode in any Operating system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

JVM

A

acts as a run-time engine to run Java applications. JVM is the one that actually calls the main method present in a java code. JVM is a part of JRE(Java Runtime Environment).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

We will go with some terminology

A

After the Java code is compiled, the bytecode gets generated, which can be executed on any machine using JVM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

We will go with some terminology

A

In Java when we write code, you will make a source code file which has .java extension, compile it using the javac compiler, and then run the compiled bytecode on a Java virtual machine.
After the Java code is compiled, the bytecode gets generated, which can be executed on any machine using JVM
Bytecode is the .class file

This is why Java is platform independent because you can run the bytecode in any Operating system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Be able to write the main method

A

The main() method is where your program starts running.
Without main method JVM
It has public keywords so that everyone can acess it.
This keyword denotes it is a class. This is the name of the class. The opening curly brace and the end braces are required.
Every satement need to end in the semicolon.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly