Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Java Tutorials for Testers: Introduction, JDK, JRE & JVM Internals

How to identify SVG elements in Selenium?

Let’s begin!

What is Java?

Java is a high-level programming language and gives us the platform to run the Java-based application as well.

Who developed Java?

James Gosling is the father of Java, and it was developed at Sun Microsystems (now owned by Oracle) in the year 1995.

Features of Java

Some of the features of Java are listed below:

  • Robust
  • Object-Oriented
  • Secure
  • Portable
  • Simple
  • Platform Independent
  • Interpreted
  • Distributed
  • Dynamic
  • Multi-threaded
  • High Performance & Optimized

What are the different types of applications built with Java?

  • Mobile Application (like Android app)
  • Desktop Application
  • Web Application
  • ERP Application
  • Smart Card
  • Gaming App
  • Embedded Systems

Java tutorials for testers

Different Editions of Java

  • Java SE (Standard Edition)
  • Java EE (Enterprise Edition)
  • Java ME (Micro Edition)
  • Java FX

What is JDK?

JDK stands for Java Development Kit. It is used to develop Java applications and it consists of the development kit, JRE, JVM, Interpreter, Compiler, Document generator, achiever and other tools. JDK can have any of the editions of Java described above.

Learn Java Topics for Selenium

What is JRE?

JRE stands for Java Runtime Environment. It contains multiple libraries to provide the environment to run any Java program.

What is JVM and Its internal architecture?

JVM stands for Java Virtual Machine. As its name depicts, this machine does not exist physically, rather it’s a virtual machine for any Operating system or platform. It provides the environment to run the Java application after executing the byte code on the compilation of the program. It is also responsible to run programs other than Java which generates Java byte codes. Scala programming language is one of them.

JVM, JRE & JDK individually is platform-dependent and Java as a whole is platform-independent language.

JVM performs certain actions internally to run the Java program, those are listed as follows:

  • It first loads the code
  • Then verifies the code
  • Further, executes the code
  • And finally, provide the runtime environment

JVM offers architecture of-

  • Class file formatting
  • Memory area
  • Program Counter Registers
  • Heap
  • Stack
  • Execution engine
  • Reporting

How to set the Java path?

There are two ways to set Java path, one is temporary and another one is permanent.

Temporary

Go to command prompt and execute the following command to set the Java path.

set path=D:\Program Files\Java\jdk1.8.0_221\bin

Permanent

You can set a permanent Java path at your system’s environment variables.

First Java program

package my.project;

public class FirstJavaProgram {

	final public static void main(String[] args) {
		System.out.println("My First Java Program");
	}

}

This is the simple program that just prints the text. Initially, it is saved as dot Java (.java) file and after compilation, it gets converted into byte code and file name gets stored with dot class (.class) extension.

Different ways to write a Java program

We can write the above java program in different ways like changing the sequence of keywords used with the main method.

  • public static void main(String args[])
  • static public void main(String args[])
  • public static void main(String []args)
  • public static void main(String… args)

Valid & Invalid main() method’s signature

Valid main() method

  • public static void main(String args[])
  • public static void main(String[] args)
  • public static void main(String []args)
  • public static void main(String… args)
  • public static final void main(String args[])
  • final strictfp public static void main(String args[])
  • final public static void main(String args[])
  • static public void main(String args[])

Invalid main() method

  • void public static main(String args[])
  • static void public main(String args[])
  • public void main(String args[])
  • static void main(String args[])
  • abstract public static void main(String args[])

This was one of the first Java tutorials for testers. Stay tuned for more series of articles for testers on Java.

OFFER! Get Trained in Software Testing by Avinash Mishra. Join Now! CLICK HERE!

The post Java Tutorials for Testers: Introduction, JDK, JRE & JVM Internals appeared first on Inviul.



This post first appeared on Inviul, please read the originial post: here

Share the post

Java Tutorials for Testers: Introduction, JDK, JRE & JVM Internals

×

Subscribe to Inviul

Get updates delivered right to your inbox!

Thank you for your subscription

×