Skip to content

Commit 620b365

Browse files
committed
adding java demo
1 parent 2cd9edf commit 620b365

File tree

6 files changed

+31
-0
lines changed

6 files changed

+31
-0
lines changed

katie/Fruit.class

494 Bytes
Binary file not shown.

katie/Fruit.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
public class Fruit {
2+
public static String name = "Fruit";
3+
// Instance variables
4+
public String color;
5+
public int size;
6+
private boolean tastesGood;
7+
8+
public void setTastesGood(boolean tastesGood) {
9+
this.tastesGood = tastesGood;
10+
}
11+
12+
public boolean getTastesGood() {
13+
return tastesGood;
14+
}
15+
}

katie/Hello.class

415 Bytes
Binary file not shown.

katie/Hello.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Hello world
2+
3+
public class Hello {
4+
public static void main(String[] args) {
5+
System.out.println("Hello Katie");
6+
}
7+
}

katie/Test.class

706 Bytes
Binary file not shown.

katie/Test.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
public class Test {
2+
public static void main(String[] args) {
3+
Fruit strawberry = new Fruit();
4+
strawberry.size = 10;
5+
strawberry.name = "katie";
6+
Fruit.name = "doug";
7+
System.out.println("" + strawberry.name);
8+
}
9+
}

0 commit comments

Comments
 (0)