Java is an Object-oriented programming language. Everything in Java is object-based and it required to create an Object to access anything in the Java language. It is Platform independent. Programs written in Java language can run in any of the platforms, in spite of JVM must be present on that corresponding platform. It has a very Simple Design, this is one of the main reason that Java is a very popular language and it is very easy to learn and implement, only the basic concept of OOP Java must be clear. Java is a very Secure language that makes it develop a virus-free application. Compiled file is an Architecture-neutral file format, so this file can run on many other processors which contain Java runtime system. It is Robust so it eliminates the error occur situations on compile time and run time by error checking. Also, Java supports Multithreading it can do multitasking simultaneously. Every single execution in java is done by the thread. It provides High Performance and uses Just-In-Time compilers. It is designed to provide the Distributed environment of the Internet. It is more Dynamic than other programming languages like C and C++, as it can adapt to every environment and can be fit to execute in an evolving environment.
Java language consists of the following things:
- Character set: It is a set of characters which can be understandable by the computer language. When we are developing an application in C language, we use only one language i.e. English language. It supports 8-bit character representation whereas, Java support 16 Bit Unicode character set. By using a 16 Bit Unicode character set, almost all the language can be supported. With the help of Internationalization [I18N] and Localization, it can support many other different languages. There are followings type of character set
- ( a to z) and (A to Z): These Character set are not the same because it is case sensitive language.
- 0 to 9: This is the combination of number, also called the number set
- All the special symbol available on your keyboard.
- Data Types: Datatype tells the size and type of data that can be stored. It is used to manage memory. There are mainly two types of Datatype are present in the Java language
- Primitive Datatype
|Data Type||Default value||Size|
- User Define Datatype: There are mainly two types of User Define Datatype
- From JDK 1.2, two more data type has been introduced
- Keywords: These are having some predefined task or predefine meaning which cannot be changed in the further program. Keywords cannot be used as Identifiers. List of keywords: For (), If, case, switch etc.
- User Define Words or Identifiers: Identifiers are the name of variables, methods, and classes. You can provide any name according to your requirement by following some of the basic rules.
- Identifiers name must not contain any special symbol other than underscore (_) and dollar ($) sign.
- Identifiers name must start with the small case but it is not mandatory.
- Identifiers name must not contain any blank space in between.
- Identifiers must not start with any numeric value.
- Any keyword cannot be used as identifiers.
- Variables: It is of some specific data type, which value can be changed in the further program. Variables are loosely coupled by memory.
Syntax: Data type var_name = value;
int a =10;
Further, it can be changed by int a =20;
- Constants: In java, there is no concept of constants. In Java, the constant is available in the list of keywords. But it is not allowed to use. In order to declare constant in java, we need to use the ‘final’ keyword.
- Final int a =10;
In Java, it is called as a final variable. Final values should be initialized explicitly by the user at the time of defining the variable otherwise, it will give compile time error. If we are not assigning any value to the class level variable then that it will be initialized automatically by JVM to its default value of their corresponding data type whereas, in case of a local variable, the local variable must be initialized explicitly by the developer before the use. It will not be initialized automatically by JVM. If the variable is mention inside the function definition then it is called as local variables.
- Literals: Literals are the value which can be assigned to its corresponding compatible variables. The following types of literals
- Integer Literals
- Floating Literals
- Character Literals
- Boolean Literals
- String Literals
- Binary Literals
- Null literals
- Operators: Operators are used to performing a special operation. It is a special symbol to do some particular operation. Various Operators are
- Arithmetic operator
- Relational operator
- Assignment operator
- Bitwise operator
- Increment operator
- Logical operator
- Ternary operator
- Instance operator
- Control statement: Usually, we don’t have any control over the flow of execution. By using the control statements we can control the flow of execution in many different ways. There are mainly following types of control statements.
- Conditional control statement
- Looping control statement
- Unconditional statement
- Array: Array is the collection of similar type of elements. In Java, an array name is a reference variable and an array is an object. The array is static in nature and it stores the element in indexing representation. There are mainly two types of array
- Static Array
- Dynamic Array
Please, feel free to drop a comment in the below comment box, if you find any doubt in the topic or you want to share any information about the topic. Happy Learning!
READ NOW :- Guide to Object Oriented Programming Concepts