You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

HelloWorld.java 616B

1234567891011121314151617181920212223
  1. //static (bei Methoden)=> keine Instanz
  2. public class HelloWorld {
  3. public static void main(String[] args){
  4. System.out.println("Hello World");
  5. int j = 0;
  6. for(int i = 0; i<=200; i++){
  7. if(i%5==0){
  8. System.out.println(i + " ist durch 5 teilbar");
  9. }
  10. if(i%10==9){
  11. System.out.println(i + " endet auf 9");
  12. }
  13. if(((i+j)%3)==0){
  14. System.out.println(i + " und " + j + " addiert ergeben " + (i+j) + " und " + (i+j) + " ist durch 3 teilbar.");
  15. }
  16. j=i;
  17. }
  18. }
  19. }