-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirstHomeworkAssignment
More file actions
34 lines (28 loc) · 964 Bytes
/
firstHomeworkAssignment
File metadata and controls
34 lines (28 loc) · 964 Bytes
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
package firstHomeworkAssignment;
public class firstHomeworkAssignment {
public static void main(String[] args) {
System.out.println("Hello World");
//all code must be in a class
// int myNum = 8;
// float myFloatNum = 420.69f;
// char myLet = 'j';
// boolean myBool = true;
// String myWords = "Cats rule";
//
// int x = 5, y = 10, z = 15;
// System.out.println(x + y + z);
//you can declare variables all in one line, java doesnt care
byte myByte = 127;
short myShort = 32767;
int myint = 2147483647;
long myLong = 9223372036854775808;
float myFlo = 55.555;
double myDoub = 66.666666;
boolean myBoo = false;
char myCharmander = 'C';
double myDoub = myint; // Auto casting: int -> double
System.out.println(myint);
System.out.println(myDoub);
System.out.println(myCharmander);
}
}