Update 'README.md'

main
mahuntington 3 weeks ago
parent 6df37f4273
commit 715a92b3c5

@ -2,81 +2,76 @@
```java
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");
}
}
```
//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++;
}
```java
String greeting = "Hello there!";
```
for(int i = 0; i < 5; i++){
//System.out.println(i);
}
```java
int myAge = 46;
int myNewAge = myAge + 2;
```
String[] cars = {"Volvo", "Toyota", "Mazda"};
//System.out.println(cars[1]);
```java
double myWeight = 144.5;
```
//printMessage();
```java
Boolean isCool = false;
if(isCool){
System.out.println("Welcome to the party");
} else {
System.out.println("Get lost dweeeeeeb");
}
```
int result = add(4, 2);
//System.out.println(result);
```java
int myAge = 46;
while(myAge < 50){
System.out.println(myAge);
myAge++;
}
```
Human matt = new Human("Matthew");
System.out.println(matt.name);
```java
for(int i = 0; i < 5; i++){
System.out.println(i);
}
```
SuperHuman superman = new SuperHuman("Clark", "flight");
superman.name = "bilbo";
System.out.println(superman.name);
//superman.power = "burping";
System.out.println(superman.getPower());
```java
String[] cars = {"Volvo", "Toyota", "Mazda"};
System.out.println(cars[1]);
```
Sedan myCar = new Sedan();
myCar.drive();
myCar.stop();
```java
class HelloWorld{
Swallow stewart = new Swallow();
stewart.fly();
void printMessage() {
System.out.println("Hi");
}
void main(String[] args){
printMessage();
}
}
```
```java
interface Bird {
void fly();
}
```
class HelloWorld{
```java
abstract class Car {
abstract void drive();
void stop(){
System.out.println("screeeeech");
int add(int a, int b){
return a + b;
}
void main(String[] args){
int result = add(4, 2);
System.out.println(result);
}
}
```
@ -88,12 +83,11 @@ class Human {
this.name = name;
}
}
```
```java
class Sedan extends Car{
void drive(){
System.out.println("vroom");
class HelloWorld{
void main(String[] args){
Human matt = new Human("Matthew");
System.out.println(matt.name);
}
}
```
@ -109,12 +103,56 @@ class SuperHuman extends Human {
return this.power;
}
}
class HelloWorld{
void main(String[] args){
SuperHuman superman = new SuperHuman("Clark", "flight");
superman.name = "bilbo";
System.out.println(superman.name);
//superman.power = "burping";
System.out.println(superman.getPower());
}
}
```
```java
abstract class Car {
abstract void drive();
void stop(){
System.out.println("screeeeech");
}
}
class Sedan extends Car{
void drive(){
System.out.println("vroom");
}
}
class HelloWorld{
void main(String[] args){
Sedan myCar = new Sedan();
myCar.drive();
myCar.stop();
}
}
```
```java
interface Bird {
void fly();
}
class Swallow implements Bird {
public void fly() {
System.out.println("sweeeee");
}
}
class HelloWorld{
void main(String[] args){
Swallow stewart = new Swallow();
stewart.fly();
}
}
```
Loading…
Cancel
Save