This tutorial describes basic language features of Java 7.This tutorial describes basic language features of Java 7.
This tutorial describes basic language features of Java 7.
Basic Language Features :
Basic language features are same for most java versions with adding some new features. Here following some basic component to build java language -
Variable : Java uses term "variable" which represents some kind of information. Objects are used to store their state in some fields. It is required to declare all the variables before you use it in your programming. You can say variable is a name given to someone who represents basic data type, default values, literals.
Operators: For doing different kind of manipulation we need operators. Java provides many operators. In general you can say operators are a special symbol that do specific operations on one or more operands and after manipulation returns some result.
Expressions, Statements, and Blocks: Expressions is formed by the operators which results some values. A complete expression create statement. You can say expressions are a basic components of your statements. When you group your statements it create a block.
Control Flow Statements: Control flow statements contain
group of statements which manages your flow of program. Java provides different
way of controlling your program like decisions-making, looping, and branching
Enhancements in Java SE 7 -
In Java 7, there are some new basic language features added. -
You can write integer type(byte, short, int and long) by using binary number system. For that you can use binary literal 0b or 0B as a prefix to the number.
Example : int roll= 0b10100001010001011010000101000101;
Now in Java SE 7,In numerical literal, you can use more than one underscore characters(_) between digits. With this feature you can distribute groups of digits in numeric.
Example : long ssNo=91_111_8888L