New Posts  All Forums:Forum Nav:

need help with java

post #1 of 2
Thread Starter 
hello everyone im looking for help with my java program (im learning on my own and would like some beginners to study together)
but anyways im making a basic calculater with java
and it keeps giving me an error and i cant figure out why
Code:
import java.util.Scanner;

class apples{
        public static void main(String args[]) {
           Scanner chris = new Scanner(System.in);
           double fnum, snum, answer;
           System.out.println("enter first number");
           fnum = chris.nextDouble();
           System.out.println("what is the second number");
           snum = chris.nextDouble();
           answer = fnum + snum;
           System.out.println(answer);
        }
}
        

theres the code

and heres error:
Code:
Exception in thread "main" java.lang.Error: Unresolved compilation problem: 

        at bucky.apples.main(apples.java:4)
post #2 of 2
Try making ur class header public class Apples{
     
CPUMotherboardGraphicsRAM
AMD A-Series A8-5600K MSI FM2-A85XA-G65 Zotac GeForce GTX 570 (ZT-50206-10M) Corsair Value Select 8GB(2x4GB) 
Hard DriveOptical DriveCoolingOS
Western Digital WD-Blue Lite-ON iHAS124-04 AMD Stock Heatsink + Fan Windows 7 Professional SP1 64-Bit 
OSPowerCase
OpenSUSE 12.3 XFX Pro 550W Core Edition NZXT Phantom 410 Special Edition Gunmetal 
CPUGraphicsRAMHard Drive
AMD Turion M x64 ATI Radeon Xpress 200M 1GB Generic 80GB 
Optical DriveOS
Phillips DVD +RW Linux Mint 15 Mate x32 
  hide details  
Reply
     
CPUMotherboardGraphicsRAM
AMD A-Series A8-5600K MSI FM2-A85XA-G65 Zotac GeForce GTX 570 (ZT-50206-10M) Corsair Value Select 8GB(2x4GB) 
Hard DriveOptical DriveCoolingOS
Western Digital WD-Blue Lite-ON iHAS124-04 AMD Stock Heatsink + Fan Windows 7 Professional SP1 64-Bit 
OSPowerCase
OpenSUSE 12.3 XFX Pro 550W Core Edition NZXT Phantom 410 Special Edition Gunmetal 
CPUGraphicsRAMHard Drive
AMD Turion M x64 ATI Radeon Xpress 200M 1GB Generic 80GB 
Optical DriveOS
Phillips DVD +RW Linux Mint 15 Mate x32 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Application Programming