This commit is contained in:
plane000
2018-08-09 21:14:10 +01:00
parent a0f946d62e
commit c18d9afaa5
29 changed files with 14057 additions and 248 deletions

View 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
View 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>

View 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++;
}
}

View 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);
}
}

Binary file not shown.

Binary file not shown.