Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Please Help Compile

843810Nov 9 2004 — edited Nov 10 2004
Hi, I'm kinda new to java programming and I'm having trouble compiling this small prgram. I really need help as it is part of an assessment and its due in soon. Any help is appreciated.

// Supplier Program

import javax.swing.JOptionPane;

public class Suppliers {

public static void main (String args[]) { // only the client program has the main method

String output="";
String [] text = ArrayMethod.getArrayOfText("Please enter the name of the supplier");
String searchItem = Keyboard.getInt("McGregor Farm Produce plc, Islay Beef Consortium, Bruntisland Barley Ltd, Highland Food Machinery, North Berwick Refrigeration Ltd, Chandler Food Hygiene Supplies plc, McFisheries Ltd, 4you2 Carve Roasts Ltd");
boolean itemFound = ArrayMethod.linearStringSearch(text, searchItem);
String occurences = ArrayMethod.CountStringOccurence(text, searchItem);

if (itemFound)
ouput = searchItem + "was found" + occurences + "times in the list";
JOptionPane.showMessageDialog(null, output, "Suppliers List Display", JOptionPane.INFORMATION_MESSAGE);
} // end if

System.exit(0);

} // end of main

} // end of NumberCounting class

Compile errors I receive:

NumberCounting.java:20: <identifier> expected
System.exit(0);
^
NumberCounting.java:24: 'class' or 'interface' expected
} // end of NumberCounting class
^
NumberCounting.java:26: 'class' or 'interface' expected

^
3 errors

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 8 2004
Added on Nov 9 2004
3 comments
129 views