Java programming language was originally developed by Sun Microsystems which was initiated by James Gosling and released in 1995 as core component of Sun Microsystems’ Java platform (Java 1.0 [J2SE]). Now it has became the one of the most popular computer programming language and is now being used by more than 2 billion devices.
Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory.
Java allows variables to be declared within any block. Scope and Lifetime of variable is determined how and where those variable is defined.
Assigning a value of one type to a variable of another type is known as Type Casting.
Like other programming languages, there are arithmetic operators, bitwise operators and logical operators in Java.
There are three types of selection or decision making statements in Java. First one is
if statement which either performs (selects) an action, if a condition is true, or skips it, if the condition is false. Second is
else statement which performs an action if a condition is true and performs a different action if the condition is false. Third one is
switch statement which performs one of many different actions, depending on the value of an expression.
Iteration statements create loops in the program. In other words, it repeats the set of statements until the condition for termination is met. Iteration statements in Java are for, while and do-while.
break, continue and return are branching statements in Java. Each of these statement has their importance while doing programming in Java.
An array is a group of like-typed variables that are referred to by a common name. Array of any type can be created and may have one or more dimensions. Arrays offer a convenient means of grouping related information.
There may be the situation where you will want to pass information into a program when you run it. This is accomplished by passing command-line arguments to main( ).