Need help! Unable to follow the Sun WBT practice.(Simple program)
Exception in thread "main" java.lang.NoSuchMethodError: main
Due to the above error, I can't follow the Sun's WBT program. I think something is missing in my Java environment since Sun provided instruction should be correct.
Please let me know to troubleshoot this.
Below causes error.(Followed the Sun WBT)
public class Customer {
public int customerID = 0; // Default ID for the customer
public char status = 'N'; // default
public double totalPurchases= 0.0; // default
// This method displays the value for an item
public void displayCustomerInfo() {
System.out.println("Customer ID:" +customerID);
System.out.println("Status: " +status);
System.out.println("Purchases: " +totalPurchases);
} // end of display method
} // end of the class
Below works since I did not use WBT instruction:
public class Customer2 {
public static void main( String args[] ) {
int customerID = 0; // Default ID for the customer
char status = 'N'; // default
double totalPurchases= 0.0; // default
System.out.println("Customer ID:" +customerID);
System.out.println("Status: " +status);
System.out.println("Purchases: " +totalPurchases);
} // end of ????( I do not know how to say here)
} // end of the class
public class Customer {
public int customerID = 0; // Default ID for the customer
public char status = 'N'; // default
public double totalPurchases= 0.0; // default
// This method displays the value for an item
public void displayCustomerInfo() {
System.out.println("Customer ID:" +customerID);
System.out.println("Status: " +status);
System.out.println("Purchases: " +totalPurchases);
} // end of display method
} // end of the class
NOTE: IF I run the above program, it does not run due to exception. I can compile it without error. Since above coding is used in the Sun WBT course, I think I have Java environment problem. Are you able to run the above program?
Similar Messages
-
I get the following message when trying to open an .avi downloaded from my video cam, need help, can not find the codec, thank you. This is for Quicktime Player.
"The document “IMAG0026.AVI” could not be opened. A required codec isn't available."Try Perian.
http://perian.org/ -
I need your help I downloaded adobe reader Xl and I still cannot open my pdf files. Please help as soon as possible I need it for work
When I try to open the file it just states that adobe is not responding. the file open up to the top of the page of the document but I cannot scroll down to read the document. Please I hope you can help me I followed the instructions.
[private data removed] -
Please i need help with switch from the us store to malaysian store how i can switch
Please i need help with switch from the us store to malaysian store how i can switch
Click here and follow the instructions to change the iTunes Store country.
(82303) -
I need help with setting up my Sun Java Studio Creator
Hello all, i need help with setting up the Studio Creator, i"m new to all that staff so is there anyone to help me just a little with all that if yes email me at [email protected] or get me on AOL Instant Messanger with the screen name: wretch17
thanks :-)Hi,
Welcome to the Creator community! Thanks for your interst in Sun Java Studio Creator. Please feel free to post any question related to creator on this forum .
Take a look the creator website at
http://developers.sun.com/prodtech/javatools/jscreator/
CreatorTeam -
I actually need help but cannot find the answer.
Please.......Lately when open a new tab it does not open with a blank page. I don't want to set my homepage as blank as when I first open Firefox, it automatically loads my hotmail page. But then if I open other pages I don't get a blank page. Help, please?
Thank you.
''[Personal information removed by moderator. Please read [[Forum and chat rules and guidelines]], thanks.]''hello, please refer to [[New Tab Page – show, hide and customize top sites]] in order to switch the feature off.
-
I buy for mac app but not for the iPad, so how do I reinstall a program that has already purchased? I need help because I bought the imovie'11 but when he opened it only brought 8 movie trailer templates instead of the 15 it says on the program. How do I solve this problem? Once paid for a program incomplete. I also liked that the AppStore itself had a button to reinstall programs already bought, because it is very hard to understand how to do this in the store, only option is to install and hide purchase, and how do I reinstall, attention'm talking about reinstalling a computer mac, not an ipad or iphone.
Thank you.Prodesigntools.com , go ahead and download the software from there and use your serial number to serialize it.
-
I need help in finding all the new fontsin iPad 2 using iOS 5
I need help in finding all the new fonts in ipad 2 using ios 5
You cannot change the email font. You can make it bold, italics and underline the type, but Helvetica is your only choice in the mail app.
In the notes app you have 3 choice Noteworthy, Helvetica and Marker Felt. The font can be changed in Settings>Notes>Font.
You can only use fonts that are built into the app that you are using at the time. You cannot pick and choose fonts from a list of all of the fonts that may be on the iPad but only from the list of fonts that the app allows. -
Yosemite made my MacBook Pro so slow !! Need help ? what is the solution?
Yosemite made my MacBook Pro so slow !! Need help ? what is the solution?
I've ran a benchmark on my Mac (iMac early 2009). Performance of Yosemite in general was about the same as Mavericks. But that can be different on other Mac's of course. Safari is mostly a bit slower. It's recommended you clean your old internet-caches and then restart Safari. (you can use a little app called CCleaner to do that). That might make a difference. Speed-issues are usually solved in the first and second update of OS X.
-
I need help! I updated the new 6.1.3 last night. Since that time my phone will not charge. The phone is plugged in and shows as charging but the battery still drains. What can I do? I need help!
Restore iPhone with iTunes on your computer.
-
I need help quick please sold the iPod and before handing it over wanted to clear out info so pushed erase now there is only a plug icon for iTunes but it won't now recognize my computer what can I do??
Try
iOS: Device not recognized in iTunes for Windows
or
iPhone, iPad, iPod touch: Device not recognized in iTunes for Mac OS X -
I had to put my computer by together without migration or time machine I NEED help with order of the files?
Hi, where are these other files exactly?
-
Need help with passcode using the "Remote" app
Hello and thanks in advance. I can't find a place on iTunes to enter the passcode from the Remote app.
PLEASE READ!!!
I have a HP Pavilion - Windows XP
I need help as well with the passcode. I went to Networking and Sharing center and clicked customize and changed the name to NetGear because that is what it says next to my WiFi on my iPhone but with my iPhone under Settings it says WiFi NETGEAR > but when I click on it, it says choose a Network. Is NETGEAR a network? How do I find or change to a Network? is this the problem? -
I Need help!!! The card I used when I first set up my account I lost it so now I can't download any music cause it's wanting a number off that card and I don't have it anymoe... Someone tell me what to do please???
Add another good card and delete the old one, Yu can also purchase and redeem an iTunes gift card and hthen delee the bad credit card. Yu need a valid payment method for update as well even purchasing free apps if the account was set up with a credit card.
-
I need help! I have the iphone 5 and I want to buy the whastsaap, but it turns out I get to put the answers up and answer the questions but I do not remember. Someone could help me? Help! Thank you!
Security questions:
https://discussions.apple.com/thread/4533485?tstart=0
Maybe you are looking for
-
Loose reception bars when 3g is turned on
no matter where I'm at. Why is that? Does the 3g symbol take the place of the bars? I may be fooling myself physchologicaly but it seems a tad faster. Don't really know if it's even working when this happens.
-
In Firefox, when I play videos (say on Apple's website for trailers), the video will play, but the toolbar at the bottom (where you can pause, see the bar that shows where you are at in the video - blanking on the name for that at the moment) does no
-
Is sun java studio creator 2 a commanly used developing tool?
I just downloaded the sun java studio creator 2,but still wonder which IDE the java programmers use in their work.Do they really program application just by the command line? I am a novice in java and what's worse, I don't have any programming experi
-
We are using a G5 2.3 and a TiBook 800 MHz. Both machine are suffering from the a very slow finder as well in finder own actions, like opening a new window as well in open commands from other applications like Photoshop, AppleWorks, ... Both computer
-
My organization is merging with another and we are currently operating with two domains while the project to migrate all of the object from one into the other is completed. SCSM is implemented on Domain A, but is syncing object from both domain A an