We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8e55ee8 commit fe55fe3Copy full SHA for fe55fe3
1 file changed
Exercise.java
@@ -1,6 +1,14 @@
1
+import java.util.Scanner;
2
+
3
public class Exercise {
4
5
public static void main(String[] args) {
- // implement exercise here
6
+ @SuppressWarnings("resource")
7
+ Scanner sc = new Scanner(System.in);
8
9
+ System.out.print("Gib bitte einen Wert zwischen -1 und -32.768 ein: ");
10
+ short s = sc.nextShort();
11
12
+ System.out.println("Ergebnis: Der vorzeichenfreie Dezimalwert betraegt " + Short.toUnsignedInt(s));
13
}
14
0 commit comments