Add Java-Kompendium book
This commit is contained in:
10
Java-Kompendium/kap5/Task1.java
Normal file
10
Java-Kompendium/kap5/Task1.java
Normal file
@@ -0,0 +1,10 @@
|
||||
public class Task1 {
|
||||
public static void main(String[] args) {
|
||||
int x;
|
||||
short y = 8;
|
||||
long z;
|
||||
|
||||
x = y;
|
||||
z = y;
|
||||
}
|
||||
}
|
||||
15
Java-Kompendium/kap5/Task2.java
Normal file
15
Java-Kompendium/kap5/Task2.java
Normal file
@@ -0,0 +1,15 @@
|
||||
import java.io.*;
|
||||
|
||||
public class Task2 {
|
||||
public static void main(String[] args) throws IOException {
|
||||
System.out.print("Geben Sie eine Zahl ein: ");
|
||||
|
||||
var inputStream = new InputStreamReader(System.in);
|
||||
var bufferedStream = new BufferedReader(inputStream);
|
||||
|
||||
String variable = bufferedStream.readLine();
|
||||
int converted = Integer.parseInt(variable);
|
||||
|
||||
System.out.println("Der doppelte Wert ist: " + (converted * 2));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user