Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.10 KB | None | 0 0
  1. package de.godlotus.main;
  2.  
  3. import java.io.File;
  4. import java.util.ArrayList;
  5. import java.util.Scanner;
  6.  
  7. import javax.swing.JOptionPane;
  8.  
  9. public class Main {
  10. public static void main(String[] args) {
  11. /*
  12. * STRG+S speichern
  13. * STRG+SPACE autovervollständigung
  14. *
  15. * STRG+SHIFT+F auto formatierung
  16. * STRG+SHIFT+O auto inport
  17. * STRG+SHIFT+S
  18. */
  19. boolean geil = true; // true/false
  20. short s = 233; // 255 - -255
  21. int i = 0; // 2M - -2M number
  22. long l = 4923749284490284L; // big number
  23. char c = '?'; // zeichen
  24. float h = 233.445355435345355345345354354353455543534535534534535435435345554353453553453453543543534555435345355345345354354353453545354535345353f;
  25. double d = 323.445355435345355345345354354353455543534535534534535435435345554353453553453453543543534555435345355345345354354353453545354535345353;
  26. byte by;
  27.  
  28. String test = "nein";
  29. File file = new File("D:/xampp1/xampp-control.txt");
  30. File config = new File("config.yaml");
  31.  
  32. System.out.println(überschrift("##### god lotus apptest #####"));
  33.  
  34. System.out.println(überschrift("if abfragen"));
  35.  
  36. if (geil) {
  37. System.out.println("Mach ich weil es geil ist!");
  38. } else if (test.equals("nein")) {
  39. System.out.println("Sie will nicht angefasst werden!");
  40. } else if (test.equals("nein")) {
  41. System.out.println("Sie will nicht angefasst werden!");
  42. } else if (test.equals("nein")) {
  43. System.out.println("Sie will nicht angefasst werden!");
  44. } else if (test.equals("nein")) {
  45. System.out.println("Sie will nicht angefasst werden!");
  46. } else {
  47. System.out.println("Nein es ist nicht geil!");
  48. }
  49.  
  50. System.out.println(überschrift("while schleife"));
  51.  
  52. while(i < 3) {
  53. System.out.println("GEILE TITTEN:" + i);
  54. i++;
  55. }
  56.  
  57. System.out.println(überschrift("do while schleife"));
  58.  
  59. i = 100;
  60. do {
  61. System.out.println("GEILE BEINE:" + i);
  62. i++;
  63. } while(i < 3);
  64.  
  65. System.out.println(überschrift("for schleife"));
  66.  
  67. for(int j = 0; j < 3; j++) {
  68. System.out.println("test:" + j);
  69. }
  70.  
  71. //ARRAY
  72. String[] stringArray = new String[5];
  73. stringArray[0] = "hallo";
  74. stringArray[1] = "welt";
  75. stringArray[2] = "ich bin";
  76. stringArray[3] = "god lotus";
  77. stringArray[4] = "god fötus rötus";
  78.  
  79. System.out.println(überschrift("array durchgang mit while schleife"));
  80.  
  81. i = 0;
  82. while(i < stringArray.length) {
  83. System.out.println("TEST:" + stringArray[i]);
  84. i++;
  85. }
  86.  
  87. System.out.println(überschrift("array durchgang mit for schleife"));
  88.  
  89. for(String value : stringArray) {
  90. System.out.println("TEST2:" + value);
  91. }
  92.  
  93. //END ARRAY
  94.  
  95. //ARRAYLIST
  96.  
  97. ArrayList<String> wortSalat = new ArrayList<String>();
  98. wortSalat.add("hey");
  99. wortSalat.add("ich");
  100. wortSalat.add("bin");
  101. wortSalat.add("der");
  102. wortSalat.add("god fötus");
  103.  
  104. System.out.println(überschrift("arraylist durchgang mit while schleife"));
  105.  
  106. i = 0;
  107. while(i < wortSalat.size()) {
  108. System.out.println("TEST:" + wortSalat.get(i));
  109. i++;
  110. }
  111.  
  112. System.out.println(überschrift("arraylist durchgang mit for schleife"));
  113. for(String value : wortSalat) {
  114. System.out.println("TEST2:" + value);
  115. }
  116.  
  117. //END ARRAYLIST
  118.  
  119. System.out.println(überschrift("console scanner"));
  120. String input = consoleInput();
  121.  
  122. System.out.println("INPUT:" + input);
  123.  
  124. System.out.println(überschrift("window input"));
  125. input = JOptionPane.showInputDialog("TEST TEXT LUL:");
  126.  
  127. JOptionPane.showMessageDialog(null, "YOUR IMPORTANT INPUT:\n" + input);
  128. }
  129.  
  130. public static String consoleInput() {
  131. Scanner scanner = new Scanner(System.in);
  132. while(!scanner.hasNext()) {}
  133. String input = scanner.next();
  134. scanner.close();
  135. return input;
  136. }
  137.  
  138. public static void test() {
  139. System.out.println("test!!!!");
  140. }
  141.  
  142. public static double getPIX2() {
  143. double pi = 3.1415;
  144. pi = pi * 2;
  145. return pi;
  146. }
  147.  
  148. public static String überschrift(String name) {
  149. return name.toUpperCase() + ":";
  150. }
  151.  
  152. public static String überschrift(String name, int i, int y) {
  153. return name.toUpperCase() + ": (" + i + "/" + y + ")";
  154. }
  155. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement