Saturday, 21 October 2017

JAVA- Data Types.

Data Types I: int

Creating more useful Java programs will likely require you to work with several additional types of data. Let's explore a few of them.
The first data type we will use is int.

1.int is short for integer, which are all positive and negative numbers, including zero. This number could represent the number of visits a website has received or the number of programming languages you know.
  1. The int data type only allows values between -2,147,483,648 and 2,147,483,647.

  2. Data Types II: boolean

  3. Fantastic! You just printed an int data type.
    The next data type we will use is the boolean.
  4. 1: A boolean is a data type that can only be   either true or false

 Data Types III: char

Perfect. Let's look at one more Java data type: char.
The char data type is used to represent single characters. That includes the keys on a keyboard that are used to produce text.
1: char is short for character and can represent a single character.
2: All char values must be enclosed in single quotes, like this: 'G'


Share:

1 comment: