Java - Programming Language
This course covers the basics of programming in Java. Work your way through the videos/articles and I'll teach you everything you need to know to start your programming journey!

Creating A Calculator

Lesson 10
Author : 🦒
Last Updated : October, 2017


Code

Copy// import java.util.Scanner;
Scanner keyboardInput = new Scanner(System.in);

System.out.print("Enter num1: ");
int num1 = keyboardInput.nextDouble(); // .nextDouble(), .nextInt()
System.out.print("Enter num2: ");
int num2 = keyboardInput.nextDouble();
System.out.println(num1 + num2);