Posts

Showing posts from April, 2024

4. Steps to Create, Compile and Execute a Java Program

Image
 How does java program work     Steps to write a java program and how it is executed.  Step 1: Writing the Source Code To create a Java program, you need an editor or an Integrated Development Environment (IDE). Some popular options include: Notepad Word Edit Plus Notepad++ Sublime Text Atom Eclipse IntelliJ IDEA NetBeans Visual Studio Code (VS Code) In the editor or IDE, you write a set of instructions using the Java programming language. This file should be saved with a   .java   extension. This file is known as the "source code." Step 2: Compiling the Java Program Receiving The  .java file, which contains the source code written by the programmer. The compiler checks the source code for any syntax errors.  If there are syntax errors, it will generate a compile-time error on the command prompt. If the syntax is correct, the compiler will generate a bytecode file with a .class extension.           Compiler giv...

3. Understanding JDK Architecture

Image
JDK ARCHITECTURE JVM (Java Virtual Machine) JVM stands for Java Virtual Machine. It is an interpreter that translates Java bytecode into machine-level language line by line. It is also known as intermediate software. The JVM is included as part of the JDK. JRE (Java Runtime Environment) JRE stands for Java Runtime Environment. It includes the JVM and a set of built-in libraries and files that are required to execute or run Java applications. The JRE provides the necessary environment for running Java programs but does not include development tools like compilers. JDK (Java Development Kit) JDK stands for Java Development Kit. It is a package offered by Oracle that provides the tools needed to develop Java applications. The JDK includes development tools such as the Java compiler (javac) and the JRE, which allows you to both develop and run Java applications.