Java Basics

Introduction

What are the input and output of a Java compiler?

  • A compiler is a software that translates the source program into a machine-language program.
  • For Java compiler, the input is Java source code which has the .java file extension.
  • The output is .class file.

What is the command to compile a Java program?

  • To compile a Java source-code file from the command line, use the javac command.

What is the command to run a Java program?

  • To run a Java class from the command line, use the java command.

What is the JVM?

  • Java Virtual Machine

What is the Java source filename extension?



The Java source file name must match the public class name in the program. 
Java source code files must end with the  .java extension.

What is the Java byte code filename extension?



Every class is compiled into a byte code file that has the same name as the class.
The file name ends with the .class extension.



Next

Related