Need help with some java :\.

0 Derek League · December 28, 2014
Basically i was following bucky's tuts on java, i was on #7.

import java.util.Scanner;

class apples{
 public static void main (String args[]){
   Scanner derek = new Scanner(System.in);
   double fnum, snum, answer;
   System.out.println("Enter First Num:");
   fnum = derek.nextDouble();
   System.out.println("Enter Second Num:");
   snum = derek.nextDouble();
      answer = fnum + snum;
   System.out.println(answer);
  }
}



Apparently according to eclipse, there is an error in line 4 " public static void main (String args[]){"

I don't see the error, and i cannot run this.

I've given other friends this exact code, and they can run it fine, anyone know why eclipse wont let me run this?

Post a Reply

Replies

Oldest  Newest  Rating
0 Jay Deshaun · December 28, 2014
try this:
public static void main (String[] args){
-1 Pere Garau Burguera · December 28, 2014
You can put 
... main (String args[])


too. The problem might be something else. 
  • 1

Java / Android Development

107,205 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator