test
parent
9b00af2bf4
commit
127773d1d9
|
@ -0,0 +1,18 @@
|
||||||
|
public class DemoConsole {
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
System.out.println("Text eingeben: ");
|
||||||
|
String text = Console.readString();
|
||||||
|
System.out.println("Gelesener Text: " + text);
|
||||||
|
|
||||||
|
System.out.println("Text eingeben: ");
|
||||||
|
char [] ca = Console.readCharArray();
|
||||||
|
System.out.println("Gelesenes char-Feld: ");
|
||||||
|
for(char celement: ca)
|
||||||
|
System.out.print(celement);
|
||||||
|
System.out.println();
|
||||||
|
|
||||||
|
System.out.println("Boolean eingeben: ");
|
||||||
|
boolean b = Console.readBoolean();
|
||||||
|
System.out.println("Gelesener Wert: " + b);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,18 @@
|
||||||
|
import java.io.*;
|
||||||
public class Übung {
|
public class Übung {
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
Console cons = System.console();
|
||||||
|
System.out.println("Text eingeben: ");
|
||||||
|
String text = cons.readLine();
|
||||||
|
System.out.println("Gelesener Text: " + text);
|
||||||
|
|
||||||
|
System.out.println("Text eingeben: ");
|
||||||
|
String text2 = cons.readLine();
|
||||||
|
for(int i = 0; i<text2.length();i++) {
|
||||||
|
|
||||||
|
}
|
||||||
|
// char [] ca = Console.readCharArray();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue