We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 96c994d commit 791c4f9Copy full SHA for 791c4f9
5.Getting_user_input/CWH_05_TakingInput.java
@@ -0,0 +1,26 @@
1
+package com.company;
2
+import java.util.Scanner;
3
+
4
+public class CWH_05_TakingInpu {
5
+ public static void main(String[] args) {
6
+ System.out.println("Taking Input From the User");
7
+ Scanner sc = new Scanner(System.in);
8
+// System.out.println("Enter number 1");
9
+// int a = sc.nextInt();
10
+// float a = sc.nextFloat();
11
+// System.out.println("Enter number 2");
12
+// int b = sc.nextInt();
13
+// float b = sc.nextFloat();
14
15
+// int sum = a +b;
16
+// float sum = a +b;
17
+// System.out.println("The sum of these numbers is");
18
+// System.out.println(sum);
19
+// boolean b1 = sc.hasNextInt();
20
+// System.out.println(b1);
21
+// String str = sc.next();
22
+ String str = sc.nextLine();
23
+ System.out.println(str);
24
25
+ }
26
+}
0 commit comments