It means there is no main class to run the program, you need to set a main class before running it.
Type: Posts; User: D.K
It means there is no main class to run the program, you need to set a main class before running it.
Not going to bother tracing that since it's not embedded. General tip for fixing the problem, identify whether a run-time error is occurring or a syntax error. If it's a run-time then check things...
Here's a tip I always use while debugging:
*) Identify the type of error (syntax, logical or run-time).
Once you have identified the type or error it'll be much easier to find what's not...
You'll need to get a Java Development Kit (JDK).
Opps, forgot that was an infinite loop XD.
Edit: if you add num++; in the while loop that will fix the infinite loop (increments num by 1 each time).
while (condition) {
statement;
}
Basically if the condition is true then the statements are executed until the condition becomes false.
Example:
Declare that answer equals to 0.
Change the integers & doubles to floats and let the scanner read it as a float [scan.nextFloat();].
Note: make sure you import the scanner class (java.util.Scanner;).
Your code is very messy, over-complicated and full of mistakes + junk code. Try re-writing a simplified version of the code.
Thanks for the feedback.
Update: made it easier to read + added for loop.
http://www.javaprogrammingforums.com/java-code-snippets-tutorials/33239-help-getting-started-java-tutorial.html#post127708
This might help.
I'll work on this thread when I open my laptop.
I wrote the following tutorial for my friend and decided I'd post it on here to help out some people :).
Some basics that aren't covered in this tutorial:
*applets
*exceptions
*cases
and some...
Make a while loop with an inner if statement and add a sentinel value to exit the loop.
No.
It is correct if the last brace is the closing of the class block.
You have the wrong formula.
Hint: you need to use the math class.
Another hint: Math.pow(num1, 3) //example
Hint: unicode.
I'm not that new to Java, I've been coding for about a year before attending AP. Escape sequences aren't that amusing :p.
What you need is an English tutorial.
Alright.
Hello everyone! I'm currently taking Java programming as an AP Computer course so I decided to join this forum :). Looking forward to meeting you all.
Well, some people just want to be spoon fed...
I have an e-book version of my Java Programming book for my AP Computer class, if you're interested drop me a private message (free).
Umm you could use a while loop inside a while loop, so basically if the user enters the loop it would execute the statements inside and then move onto the inner loop (which would also execute their...
JavaScript is for browsers while Java is an object-oriented language that is compiled (to create an executable version) and later executed on the main memory.