Introduction to the Java language - ProgrammerTech
Language:

Search

Introduction to the Java language

  • Share this:
Introduction to the Java language

The structure of the Java program

In terms of the general structure of the program, JAVA follows the method of object-oriented programming (oop).

In the era of technology and the digital world, programming has become the wheel of business development, which has led to the demand of customers and users towards web applications and smart phone applications.

One of the most important features of the Java language is that it is an open source language, that is, accessible to everyone. The second point is an object-oriented language, and this facilitates work in it.

Also, java can deal with all operating systems, and finally when you master the java language, you can easily learn and deal with other languages.

JAVA is a high-level programming language developed by James Gosling in 1991.

During his period of work in the laboratories of the company "Sun Microsystems" Sun Microsystems, in order to use it as a thinking mind to operate smart devices.

It was developed in 1995 in order to build applications for the web, servers, desktop, phones and bots, and it works on all operating systems.

 

Java Mechanism

What distinguishes Java is its ability to work on all systems in general, and this goes back to the JVM, which is an abbreviation for the English term (Java Virtual Machine).

Which translates the Java code to suit the system you are working on, where the Java compiler converts the code to BiteCode so that the system can deal with it through the JVM.

 

Security in Java

Java is considered one of the safe languages ​​of the JVM, hence the power of Java as the code can only be executed on the JVM.

It contains the protection manager who has procedures that check the security standards and if they are passed. The code will work on the system, otherwise it will reject it.

 

Versions Java

In Java there are three main versions that programmers rely on.

  1. Java SE (Stander Edition) This is the simplest version of Java and this is for programs that run on computer systems.
  2. Java EE (Enterprise Edition) This version is specialized in the field of the web and dealing with databases (Database).
  3. Java ME (Mobile Edition) This version is for mobile applications running the Java system.
  4. Java FX This version contains offices and is specialized in building interfaces, in particular, it supports building interfaces.

When building a Java program, you must first create an A class.

Public Class class_Name

What is meant by className is the name of the class, and it is desirable that the name of the class indicates the work of the program, and the choice is open to you when naming the class.

For example, if we want to create a simple program by adding two numbers here, we can give the class a name that indicates the program’s work, which is Add, then the class name line will be as follows

public class add

After naming the class, we open a bracket and do not close the bracket until at the end of the program. This means that the code that we will write in Java is inside the class.

The next line after the class name is the construction of the main function.

What is meant by the main function is that this function is the starting point of the execution of commands, that is, the commands will be executed sequentially from the first line in the main function.

The structure or form of the main function in the Java program is in the form

Public static void main (string [] args)

What is meant here by the word public is public, and any variable or function defined as public means that we can access it and reuse it outside the class.

And the word static means that the function or variable that is defined as static allows us to access it directly without creating the word Object and this will be discussed later.

The word main means main and this word is reserved only for the main function.

In parentheses is an array called args of type string that is built to receive values ​​from outside the class.

public class main{
    Public static void main (string [] args)
    {
        System.out.println("Programmer Tech");
    }
}

This example shows how to create a simple program that prints the word Programmer Tech with the print command System.out.println.

 

difference between JVM, JRE and JDK

The JVM is the abbreviation of java virtual machine, that is, when the compiler processes the code, it converts it into a bitcode file, and this file cannot be handled by the jvm and converts it into a code that the host machine understands.

The JRE is the abbreviation of the java run environment, and it contains the Java desks and the desks added by the programmer, and it contains the tools necessary for the work of Java.

The JDK stands for java development kit and is the Java development environment that houses the JRE, compiler and other tools.

 

Java editors

  1. eclipse.
  2. NetBeans.
  3. vscode.
  4. intellij IDEA.
  5. Android Studio.

 

Module java

They are codes that facilitate the construction of applications and so that the programmer does not build his application from scratch. There are ready-made codes (libraries) that help him write a little code and complete a lot of commands.

In Java, there are many offices that support the programmer's work. These offices (import java.io) help in the process of reading and printing data, as we will see in later articles.

 

The concept of data entry and output in Java

Data entry means taking the value from the application user, and data output which is printing the values ​​to the user.

One of the most important things in applications is dealing with the user of the application, and this is by taking data from the user and printing the values ​​for him to see.

System.out.print("anything");   //for printing
System.console().readLine();    //to read

 

The concept of variables in java

They refer to an address reserved in the device's cache. These variables work with the application and expire.

Variables can change their value an infinite number of times in the application and the variables have many forms, they can be as a number (int) or as text (string) or come in other forms, and they are many such as letters and numbers with commas, etc. It is hardly an application devoid of variables, as it is one of the essentials in Application work.


Muhammad Alush

Muhammad Alush

إسمي محمد تركي العلوش محب للتقنية و التعلم الذاتي, و جميع خبراتي تعلمتها ذاتياً, و اللغات البرمجية التي أتقنها هي html, css, javascript, php, c, python بالإضافة إلى حبي الكبير لمجال الشبكات.

موقعي programmer-tech.com