Java Basics exercises tutorials teach you about the basic of the Java language that includes its definition, feature, code, keywords, etc.
Java is a programming language that is used widely by the programmers across the world to develop applications and softwares for mobile, desktop and tablet. Java has evolved from C and C++ but has since then become better with more code and flexibility than these languages. Business intranet application, e-business software, computing functions etc use the language.
To run Java , a device needs Java Runtime Environment (JRE) that consists of Java Virtual Machine (JVM), Java classes and Java libraries. Most of the web browser today has JRE support.
- Java is Portable or Platform Independent: Portability and Platform independent, both have the same meaning. Java compiles the code in bytecode and JRE executes this bytecode hence it can be compiled anywhere and can be run anywhere. This feature is known as WORA (Write Once Run Anywhere)
- Java is an Object Oriented language: This means that no coding can be carried out outside the class definition and a class library is available.
- Java language is considered secure when compared to other languages. It is quite difficult to write code and viruses in the language.
- There are several features in Java that saves the code written in Java to crash.
- Java programming language has automatic garbage collection that deletes the object that are not in use and frees the resources.
- Multithreading is allowed in Java in which two or more threads runs simultaneously saving time.
- Java language has built-in Networking.
In Java, keywords are used in datatypes, methods, class declaration, etc. Keywords are reserved words that come along with JDK (Java Development kit).
Some of the keywords in Java are:
There are two types of data types in Java:
- Primitive Data type: Primitive Data types are pre defined by the compiler JVM (Java Virtual Machine). Primitive Data types are int, char, float, double, boolean, short, byte, long, string.
- Non- Primitive Data type: Non- Primitive Data type also known as reference type that has object and class.