Unit 1 Video Hacks
Java hacks from Unit 1 Video
public class Printing {
public static void main (String[] args) {
System.out.println("Sahil");
System.out.println("Nathan");
System.out.println("Kurtis");
System.out.println("Rohit");
}
}
Printing.main(null);
public class Biodata {
public static void main(String[] args) {
String name = "Sahil";
int age = 17;
boolean underclassmen = false;
float height = 6;
System.out.println(name);
System.out.println(age);
System.out.println(underclassmen);
System.out.println(height);
}
}
Biodata.main(null);
public class Num {
public static void main(String[] args) {
double num = (6 * 1234124 / 11345 - 890809 + 90800) % 980098;
num = num / 100;
System.out.println(num);
}
}
Num.main(null);
public class Operators {
public static void main(String[] args) {
int x = 0;
x += 5;
x -= 4;
x *= 20;
x /= 5;
x /= 2;
x %= 2;
x ++;
x --;
System.out.println(x);
}
}
Operators.main(null);
public class CastActivity {
public static void main(String[] args) {
int num1 = (int) 123456.123456;
System.out.println(num1);
int num2 = (int) 678901234567890;
System.out.println(num2);
}
}
CastActivity.main(null);