You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.1 KiB
64 lines
1.1 KiB
class HelloWorld{
|
|
|
|
void printMessage() {
|
|
System.out.println("Hi");
|
|
}
|
|
|
|
int add(int a, int b){
|
|
return a + b;
|
|
}
|
|
|
|
void main(String[] args){
|
|
|
|
//System.out.println("Hello, Matt");
|
|
|
|
String greeting = "Hello there!";
|
|
|
|
int myAge = 46;
|
|
int myNewAge = myAge + 2;
|
|
double myWeight = 144.5;
|
|
//System.out.println(myWeight);
|
|
|
|
Boolean isCool = false;
|
|
if(isCool){
|
|
//System.out.println("Welcome to the party");
|
|
} else {
|
|
//System.out.println("Get lost dweeeeeeb");
|
|
}
|
|
|
|
while(myAge < 50){
|
|
//System.out.println(myAge);
|
|
myAge++;
|
|
}
|
|
|
|
for(int i = 0; i < 5; i++){
|
|
//System.out.println(i);
|
|
}
|
|
|
|
String[] cars = {"Volvo", "Toyota", "Mazda"};
|
|
//System.out.println(cars[1]);
|
|
|
|
//printMessage();
|
|
|
|
int result = add(4, 2);
|
|
//System.out.println(result);
|
|
|
|
Human matt = new Human("Matthew");
|
|
System.out.println(matt.name);
|
|
|
|
SuperHuman superman = new SuperHuman("Clark", "flight");
|
|
superman.name = "bilbo";
|
|
System.out.println(superman.name);
|
|
//superman.power = "burping";
|
|
System.out.println(superman.getPower());
|
|
|
|
Sedan myCar = new Sedan();
|
|
myCar.drive();
|
|
myCar.stop();
|
|
|
|
Swallow stewart = new Swallow();
|
|
stewart.fly();
|
|
}
|
|
|
|
}
|