Posts

Showing posts from January 5, 2023

Data types

Data Types Data Types byte used to store the small digit numbers Range = -128 to 127 short used to small numbers Range = -32768 to 32767 int used to store integer values Depends upon processor char used to store any single character uses 2 bytess in java and 1 byte in C float used to store the decimal values upto 6 decimals Place 'f' after the last digit of the number double used to store the decimal values upto 8 - 10 decimals long used to large numbers Place 'L' after the last digit of the number NOTE:- If we the given range is exceed its range value then it comes from lower to upper range repeatedly Example : - byte a=128; byte b=130; System.out.println(a+" "+b); output :- -128 -126

Operators

Operators Operators Arithemetic Operators + Addition 1+2 - Subtraction 2-3 * Multiplication 3*4 / Division 4/3 % Modules 5%3 Unary Operators ++ Increament a++ or ++a -- Decrement a-- or --a + Unary Plus +a - Unary Minus -a Assignment Operators = equals a=a+b a+=b a=a-b a-=b a=a*b a*=b a=a/b a/=b a=a%b a%=b Relational Operators < Lessthan a < b > Greaterthan a > b <= Lessthan or Equal to a <= b >= Greaterthan or Equal to a >= b == Equalto a == b != Not Equal to a != b Bitwise Operators & Bitwise AND a&b | Bitwise OR a|b ! Bitwise NOT a!b Logical Operators && Logical AND a&&b || Logical OR a||b ! Logical NOT !TRUE or !FALSE