From 715a92b3c52a663d154a72b784d42cb695bf4425 Mon Sep 17 00:00:00 2001 From: mahuntington Date: Thu, 22 Oct 2026 14:47:05 -0400 Subject: [PATCH] Update 'README.md' --- README.md | 166 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 102 insertions(+), 64 deletions(-) diff --git a/README.md b/README.md index 8e5f03e..b6fcc2f 100644 --- a/README.md +++ b/README.md @@ -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"); } } -``` \ No newline at end of file +class HelloWorld{ + void main(String[] args){ + Swallow stewart = new Swallow(); + stewart.fly(); + } + +} +```