Back to Browse

4. Variables in java

54 views
Jul 18, 2023
14:44

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 Syntax type variableName = value; Examples: String name = "Srikanth"; System.out.println(name);

Download

0 formats

No download links available.

4. Variables in java | NatokHD