Results 1 to 5 of 5
Thread: simple question
- 08-05-2012, 01:38 AM #1
Member
- Join Date
- Jul 2012
- Posts
- 93
- Rep Power
- 0
- 08-05-2012, 01:57 AM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,606
- Rep Power
- 5
Re: simple question
What did it return when you ran it?
- 08-05-2012, 02:09 AM #3
Member
- Join Date
- Jul 2012
- Posts
- 93
- Rep Power
- 0
Re: simple question
I copied and pasted it in Netbeans:
package disposable;
public class Disposable {
public static int main(String[] args) {
int d = 2;
int k = "ZNE".hashCode() % 3000;
int l = "THB".hashCode() % 3000;
for (int x = 0; x <= l; x++)
d = (d ^ x) % k;
return d;
}
}
and it said there was no main method.
- 08-05-2012, 02:11 AM #4
Member
- Join Date
- Jul 2012
- Posts
- 93
- Rep Power
- 0
Re: simple question
I'm sorry I mean no main classes.
- 08-05-2012, 02:31 AM #5
Student
- Join Date
- Jul 2012
- Location
- United States
- Posts
- 328
- Rep Power
- 1
Re: simple question
The return of the main method should be void. Judging from your code, you should place your calculations into a separate method and call that method from the main method. Or you could just print d instead of returning it if you want to see the result.
"Success is not final, failure is not fatal: it is the courage to continue that counts." - Winston Churchill
Similar Threads
-
Simple Question
By new2oojava in forum New To JavaReplies: 1Last Post: 09-29-2011, 07:14 AM -
Simple question...
By Onyx in forum New To JavaReplies: 10Last Post: 08-10-2011, 10:44 PM -
Simple question
By Qsc in forum New To JavaReplies: 6Last Post: 03-06-2011, 11:24 PM -
Simple Question
By stackptr89 in forum New To JavaReplies: 13Last Post: 01-29-2011, 05:35 PM -
very simple Question
By arsenal4ever_11 in forum NetBeansReplies: 2Last Post: 05-27-2010, 08:51 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks