-
Notifications
You must be signed in to change notification settings - Fork 0
/
Variables.java
executable file
·61 lines (52 loc) · 2.04 KB
/
Variables.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//******************************************************************************
//Miles Robertson
//9-8-16
//Period 6
//Used to learn how to use variables and print them
//******************************************************************************
import java.util.*;
public class Variables
{
public static void main ( String[] args )
{
//define 1 variable of each of the
//following data types
//byte, short, int, long,
//float, double,
//char, boolean, String,
//integer variables
byte byteOne = 127;
short sh = -32123;
int i = 90877;
long l = 999999999;
float f = 38.5678f;
double d = 923.234;
char c = 'A';
boolean b = true;
String st = "hello world";
System.out.println("/////////////////////////////////");
System.out.println("*Miles Robertson 07/18/02*");
System.out.println("* *");
System.out.println("* integer types *");
System.out.println("* *");
System.out.println("*8 bit - byteOne = "+byteOne+"\t\t*");
System.out.println("*16 bit - shortOne = "+sh+" *");
System.out.println("*32 bit - intOne = "+i+" *");
System.out.println("*64 bit - longOne = "+l+" *");
System.out.println("* *");
System.out.println("* real types *");
System.out.println("* *");
System.out.println("*32 bit - floatOne = "+f+" *");
System.out.println("*64 bit - doubleOne = "+d+" *");
System.out.println("* *");
System.out.println("* other integer types *");
System.out.println("* *");
System.out.println("*16 bit - charOne = "+c+" *");
System.out.println("* *");
System.out.println("* other types *");
System.out.println("* *");
System.out.println("*booleanOne = "+b+" *");
System.out.println("*stringOne = "+st+" *");
System.out.println("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\");
}
}