Back | Reverse | Quick Reply | Post Reply |

about jdk
Link | by Atsuku(binku) on 2007-06-04 04:21:59
Spec : pentium ht or dualcore;
window platform;
trouble : compile = succes, run = 'excetion in thread 'main' java.lang.nodeffoundclasserror.
the strangest thing is my ht ever work , but now not anymore.
What's really happen?

Re: about jdk
Link | by psoplayer on 2007-06-04 08:47:02
Well, let's see some code, shall we? Possibly your 'main' class?


Re: about jdk
Link | by Atsuku(binku) on 2007-06-30 21:34:09 (edited 2007-06-30 22:03:13)
I guarantee the code was correct and has the main class, the strangest thing is i ever could run it, but in several weeks... i couldn't, with the same .java or/and .class , maybe because there's a crash in framework, maybe from xampp or micro.vis.studio that i've installed.

//All right , for the clearness :
class first {
public static void main (String[]args){
System.out.println("Holla");
}
}

Re: about jdk
Link | by ruyvlopez on 2007-07-01 07:12:51 (edited 2007-07-01 07:14:27)
I see that your class name was "first", so your file name must be "first.java", if not, the "compilation" become "success" but the "execution" have "errors".

But be sure that you install SDK (example Java SDK ver1.5).

Also just kind of practice, Change thse code as example below. But even you use one of those code, it is OK.

From this code...
public static void main (String[]args){

Into this...
public static void main (String args[]){

Re: about jdk
Link | by psoplayer on 2007-07-07 07:37:49
No, keep the (String[] args) the way it is. That's how it is supposed to be. You declare an array of strings named 'args' not one string, being an array of args.


Re: about jdk
Link | by kougyounushi on 2007-07-09 13:35:24
well object oriented pogramming i assume?
um, i agree with psoplayer.. just leave it like that (String[]args)..
its nothing to do with the arguments..

@binku: what i think is, you just make a logic error.. which mean the output does not produce the correct statement you want.

Re: about jdk
Link | by Atsuku(binku) on 2007-07-18 22:56:16
Umm, sorry but Ruy Lopez was right, it's on every book of java. i was a little 'drunk' when i write that thread(maybe ^_^). I make sure that i has named the ?.java same with the name of the name class. And yes, this is the main problem.

Re: about jdk
Link | by ruyvlopez on 2007-08-28 22:05:28
Yeah! It's what I just post in here. My codes has no miss. But I will clarify what I just post here for some poeple there.

It is so confusing what's the difference between "String[] args" and "String args[]". But even though, they are equal if you didn't type other codes in between those brackets (ex: elements in a array, objects, some methods or arguments, or codes that affect String and Arguments or "args". I don't want to explain all of those things). If you leave those brackets blank, "String[] args" and "String args[]" are the same.

But in some reasons, "String args[]" is more usable. So for practice only, use String args[]. If you insist, it's ok to use "String[] args" also.

Back | Reverse | Quick Reply | Post Reply |

Copyright 2000-2024 Gendou | Terms of Use | Page loaded in 0.0021 seconds at 2024-05-04 10:56:47