Java Basics :- --------------- Java variables Data types Variables:- Variables are containers for storing data values. In Java, there are different types of variables, for example: String - stores text, such as "Hello". String values are surrounded by double quotes int - stores integers (whole numbers), without decimals, such as 123 or -123 float - stores floating point numbers, with decimals, such as 19.99 or -19.99 char - stores single characters, such as 'a' or 'B'. Char values are surrounded by single quotes boolean - stores values with two states: true or false Declaring Variables :- Syntax : type variable = value; Data Types : - it specify Type of data Primitive Data Types : A primitive data type specifies the size and type of variable values, and it has no additional methods. There are eight primitive data types in Java: Data Type Size Description byte 1 byte Stores ...
Comments
Post a Comment