react
This commit is contained in:
2
Java/TestingJava/TestingJava.iml
Normal file
2
Java/TestingJava/TestingJava.iml
Normal file
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4" />
|
||||
11
Java/TestingJava/pom.xml
Normal file
11
Java/TestingJava/pom.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>Ben (plane000)#8618</groupId>
|
||||
<artifactId>Testing Java</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
</project>
|
||||
13
Java/TestingJava/src/main/java/Person.java
Normal file
13
Java/TestingJava/src/main/java/Person.java
Normal file
@@ -0,0 +1,13 @@
|
||||
class Person {
|
||||
public String name;
|
||||
public int age;
|
||||
|
||||
public Person(String name, int age) {
|
||||
this.name = name;
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
public void getOlder() {
|
||||
this.age++;
|
||||
}
|
||||
}
|
||||
12
Java/TestingJava/src/main/java/Program.java
Normal file
12
Java/TestingJava/src/main/java/Program.java
Normal file
@@ -0,0 +1,12 @@
|
||||
public class Program {
|
||||
public static void main(String[] args) {
|
||||
Person dave = new Person("Dave", 16);
|
||||
Person kyle = new Person("Kyle", 22);
|
||||
System.out.println("Dave is " + dave.age);
|
||||
System.out.println("Kyle is " + kyle.age);
|
||||
dave.getOlder();
|
||||
kyle.getOlder();
|
||||
System.out.println("Dave got older, dave is now " + dave.age);
|
||||
System.out.println("Kyle got older, dave is now " + kyle.age);
|
||||
}
|
||||
}
|
||||
BIN
Java/TestingJava/target/classes/Person.class
Normal file
BIN
Java/TestingJava/target/classes/Person.class
Normal file
Binary file not shown.
BIN
Java/TestingJava/target/classes/Program.class
Normal file
BIN
Java/TestingJava/target/classes/Program.class
Normal file
Binary file not shown.
Reference in New Issue
Block a user