Lest's Start JAVA Programming
Part 3
Getting User input to the program (Keyboard Inputs)
To get user input from terminal we use object call Scanner and it is located in, in-build JAVA package call java.util. so we need to import java.util to our code and use Scanner to get user input.
Let's see some examples
Example 01.
Example 02.
Java Defined Data Types
Mainly there is 4 types. This main types have more types inside them.
- Numbers without decimal points. Ex:- 1,2,3,4,5
- bite
- short
- int
- long
- Numbers that have decimal points. Ex:- 0.34, 5.2, 100.5
- float
- double
- characters. Ex:- A, B, H
- char
- logical. Ex:- true or false.
- boolean
Comments
Post a Comment