<?xml version="1.0" encoding="UTF-8"?> | |||||
<project version="4"> | |||||
<component name="VcsDirectoryMappings"> | |||||
<mapping directory="$PROJECT_DIR$" vcs="Git" /> | |||||
</component> | |||||
</project> |
<?xml version="1.0" encoding="UTF-8"?> | |||||
<module type="JAVA_MODULE" version="4"> | |||||
<component name="NewModuleRootManager" inherit-compiler-output="true"> | |||||
<exclude-output /> | |||||
<content url="file://$MODULE_DIR$"> | |||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> | |||||
</content> | |||||
<orderEntry type="inheritedJdk" /> | |||||
<orderEntry type="sourceFolder" forTests="false" /> | |||||
</component> | |||||
</module> |
//static (bei Methoden)=> keine Instanz | |||||
public class HelloWorld { | |||||
public static void main(String[] args){ | |||||
System.out.println("Hello World"); | |||||
int j = 0; | |||||
for(int i = 0; i<=200; i++){ | |||||
if(i%5==0){ | |||||
System.out.println(i + " ist durch 5 teilbar"); | |||||
} | |||||
if(i%10==9){ | |||||
System.out.println(i + " endet auf 9"); | |||||
} | |||||
if(((i+j)%3)==0){ | |||||
System.out.println(i + " und " + j + " addiert ergeben " + (i+j) + " und " + (i+j) + " ist durch 3 teilbar."); | |||||
} | |||||
j=i; | |||||
} | |||||
} | |||||
} |
public class Visitenkarte { | |||||
public String name; | |||||
public String firstName; | |||||
public String job; | |||||
public String age; | |||||
public String address; | |||||
public String phoneNumber; | |||||
public Visitenkarte(String name, String firstName, String job, String age, String address, String phoneNumber){ | |||||
this.name = name; | |||||
this.firstName = firstName; | |||||
this.job = job; | |||||
this.age = age; | |||||
this.address = address; | |||||
this.phoneNumber = phoneNumber; | |||||
} | |||||
public static void printVisitenkarte(Visitenkarte a){ | |||||
System.out.println("-----------------------------------"); | |||||
System.out.println(a.name + ", " + a.firstName); | |||||
System.out.println(a.job + ", " + a.age); | |||||
System.out.println(a.address); | |||||
System.out.println(a.phoneNumber); | |||||
System.out.println("-----------------------------------"); | |||||
} | |||||
public static void main(String[] args) { | |||||
Visitenkarte tabea = new Visitenkarte("Strauss", "Tabea", "student", "27", "Untere Baustr. NBG", "017712345"); | |||||
printVisitenkarte(tabea); | |||||
} | |||||
} |