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

    Java Performance

    Java Tutorials /

    Improving Java Performance with Multithreading

    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

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

    Recent Posts

    • ChatGPT Subscription Plans
    • Stellar Converter for Database
    • Stellar Log Analyzer for MySQL
    • Stellar Repair for MySQL
    • ChatGPT Capabilities
    • How to secure your SQL Database: Tips and Tricks
    • ChatGPT4 Conversational AI Features
    • Shaping the Future of Development: Exploring Key Trends in Software Engineering
    • Improving Java Performance with Multithreading
    • Open-source Vector Databases

    Back to Top

    Links

    • Contact
    • Privacy Policy
    • Cookie Policy

    www.TestingDocs.com