TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

Java Tutorials

Introduction to Java Language

Introduction to Java

Java is an object-oriented programming language. It is a high-level, multi-threaded, portable, secure, platform-independent language. Java is guaranteed to be Write Once, Run Anywhere(WORA). It is designed for the internet and web applications.

History of Java

Java History

Java is Object-Oriented

Almost everything in  Java is an Object. Object-oriented programming is a programming methodology. OOPs is a method of implementation in which programs are organized as collections of objects, each of which represents an instance of some class. Java program can be easily extended since it is based on the object model.

Write Once and Run Anywhere(WORA)

Java is compiled to be byte code which is the intermediate language between source code and machine code. This byte code is not platform specific and hence can run on any platform.

 

Java Program Execution Java Tutorials

OOP Principles

Basic OOP( Object-oriented Programming) Principles or common jargon of Java are:

  • Class
  • Object
  • Encapsulation
  • Abstraction
  • Inheritance
  • Polymorphism

OOPs is a method of implementation in which programs are organized as collections of objects.

Example

We would write a simple class in Java to print Hello World! on the console. You can choose your favorite IDE to write the program. I prefer either Eclipse or IntelliJ IDEA. We use Eclipse here to write the class code snippet.

You can create a new class from the menu shown and highlighted below :

 

Class_In_Eclipse_Java_Introduction

Sample Class

Sample class to print HelloWorld! text on the console.

public class HelloWorld
 {
 public static void main(String[] args)
 {
 System.out.println("Hello World!");
 }
}

 

To run the program choose Right click –> Run as –> Java Application

 

Basic Jargon

Keywords are reserved identifiers that are predefined in Java language. example class, method, etc.

Identifier: A name in a program is called an identifier. An identifier may be any sequence of uppercase and lowercase letters, numbers, etc. Keep the identifier name descriptive which increases the readability and understanding of the program.

Note that: Identifiers must not begin with a number or any special character other than _ and $.

Variable: variable is the basic unit of storage in a Java program. All variables have a scope, which defines their visibility. ( private, public, protected, default )

Java is very popular and Java knowledge is essential for automation engineers. Object-oriented programming skills make it easy to learn automation and develop object-oriented automation frameworks.

—

Java Tutorials

Java Tutorial on this website:

https://www.testingdocs.com/java-tutorial/

For more information on Java, visit the official website :

https://www.oracle.com/java/

Related Posts

Download Greenfoot Windows

Java Tutorials /

Download & Install Greenfoot on Windows

Java Tutorials /

Java Static Code Analysis

Java Tutorials /

Java Testing Tools

Java Tutorials /

Handle Multiple Exceptions in Java

Exceptions_In_Java

Java Tutorials /

Exceptions in Java Programs

‹ Read from Standard Input using Scanner› Array of Objects in Java

Recent Posts

  • Update draw.io on Windows
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com