Java Tutorial
- Runtime
- java 21.0.12
- Files
- 60 files · 24 KB
- Runs
- 50 runs
- Published
package sessionSix;import java.util.*;public class TurningTextToNumbers { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String a = sc.nextLine(); String b = sc.nextLine(); System.out.println(a + b); // Integer.parseInt is used to convert Text to Integer int x = Integer.parseInt(a); int y = Integer.parseInt(b); System.out.println(x + y); }}