lump360
|
  |
| Joined: 09 Dec 2006 |
| Total Posts: 328 |
|
|
| 15 Sep 2011 11:53 AM |
class derp{ public static void main (String args[]) { int counter = 5; while (counter < 10) { System.out.println("goofd"); } } }
Anything wrong? I get a main class error when I run it.
|
|
|
| Report Abuse |
|
|
| |
|
lump360
|
  |
| Joined: 09 Dec 2006 |
| Total Posts: 328 |
|
|
| 15 Sep 2011 11:55 AM |
kid
what r you doin in my howse |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 15 Sep 2011 11:59 AM |
| Actualy, what are you doing in our house? |
|
|
| Report Abuse |
|
|
wii4
|
  |
| Joined: 27 Nov 2007 |
| Total Posts: 929 |
|
|
| 15 Sep 2011 02:53 PM |
| You got this all wrong its Java is failing not failing at java. |
|
|
| Report Abuse |
|
|
pwnedu46
|
  |
| Joined: 23 May 2009 |
| Total Posts: 7534 |
|
|
| 15 Sep 2011 03:45 PM |
inb4localchumragecuzurusingjava.
~ pwnedu46 ~ |
|
|
| Report Abuse |
|
|
|
| 15 Sep 2011 03:50 PM |
public class derp { public static void main (String args[]) { int counter = 5; while (counter < 10) { System.out.println("goofd"); } } } |
|
|
| Report Abuse |
|
|
pwnedu46
|
  |
| Joined: 23 May 2009 |
| Total Posts: 7534 |
|
|
| 15 Sep 2011 03:50 PM |
Several things wrong...
public class derp{ // must define private, public, friend public static void main (String args[]) { int counter = 5; do { System.out.println("goofd"); counter++; // must increment counter or it's an infinite loop. } while (counter < 10); } }
~ pwnedu46 ~ |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 15 Sep 2011 03:51 PM |
| Is the name of your java file derp.java? |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 15 Sep 2011 03:52 PM |
@pwn
Actually his script would work. |
|
|
| Report Abuse |
|
|
pwnedu46
|
  |
| Joined: 23 May 2009 |
| Total Posts: 7534 |
|
|
| 15 Sep 2011 04:01 PM |
ogm hax! it does work without public... o_e
~ pwnedu46 ~ |
|
|
| Report Abuse |
|
|
lump360
|
  |
| Joined: 09 Dec 2006 |
| Total Posts: 328 |
|
|
| 15 Sep 2011 04:21 PM |
| im not that much of a fail, I didn't define public/private etc. because I knew it wasn't needed in this case. |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 15 Sep 2011 04:22 PM |
@lump
So the only other possible errors are
A. You're compiling wrong B. You didn't name the file derp.java |
|
|
| Report Abuse |
|
|
lump360
|
  |
| Joined: 09 Dec 2006 |
| Total Posts: 328 |
|
|
| 15 Sep 2011 04:24 PM |
| Most likely compiling wrong (or eclipse fails). I checked, re checked and then checked again against what I was reading and I was CERTAIN that this was right, but it just refused to work. |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 15 Sep 2011 04:25 PM |
| Eclipse does make simple proccesses extremely complicated, try using JCreator instead maybe? |
|
|
| Report Abuse |
|
|
lump360
|
  |
| Joined: 09 Dec 2006 |
| Total Posts: 328 |
|
| |
|