Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Java on Eclipse calculator issue(Java on Eclipse calculator issue)
Java on Eclipse calculator issue [message #1740253] Wed, 10 August 2016 18:41
Samuel Oliveira is currently offline Samuel OliveiraFriend
Messages: 2
Registered: August 2016
Junior Member
I'm having this is problem on eclipse, after i make the program run it shows this:

Enter first number:
Exception in thread "main" java.util.InputMismatchException
at java.util.Scanner.throwFor(Unknown Source)
at Source)
at java.util.Scanner.nextDouble(Unknown Source)
at BuildingaBasicCalculator.main(

Here is the program of the calculator:

import java.util.Scanner;
class BuildingaBasicCalculator {

public static void main (String args[]){
Scanner sam = new Scanner(;
double fnum, snum, answer;

System.out.println("Enter first number: ");
fnum = sam.nextDouble();

System.out.println("Enter second number: ");
snum = sam.nextDouble();

answer = fnum + snum;

Previous Topic:Eclipse IDE : features to include?
Next Topic:Imposible to select the classes methods with Eclipse Neon JSDT
Goto Forum:

Current Time: Wed Aug 21 01:32:09 GMT 2019

Powered by FUDForum. Page generated in 0.02295 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top