Results 1 to 5 of 5
- 03-10-2011, 11:47 AM #1
Member
- Join Date
- Mar 2011
- Posts
- 20
- Rep Power
- 0
i can compile but not run the program???
hey hey guys... im sitting here and i have the small problem that i can compile the program but when i run the program it says that there is an error... can you pleas help me??
class DagTaeller {
public static void main(String[] argumenter) {
int årInd = 2003;
int månedeInd = 12;
if (argumenter.length > 0)
månedeInd = Integer.parseInt(argumenter[0]);
if (argumenter.length > 1)
årInd = Integer.parseInt(argumenter[1]);
System.out.println(månedeInd + "/" + årInd + " har " + tælDage(månedeInd, årInd) + " dage.");
}
static int tælDage(int månede, int år) {
int antal = -1;
switch (månede) {
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
antal = 31;
break;
case 4:
case 6:
case 9:
case 11:
antal = 30;
break;
case 2:
if (år % 4 == 0)
antal = 29;
else
antal = 28;
if ((år % 100 == 0) & (år % 400 != 0))
antal = 28;
}
return antal;
}
}
- 03-10-2011, 12:02 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
- 03-10-2011, 12:09 PM #3
Member
- Join Date
- Mar 2011
- Posts
- 20
- Rep Power
- 0
this is the error :
Exception in thread "main" java.lang.NoClassDefFoundError: Dagtaeller (wrong name: DagTaeller)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader. java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java :616)
at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader .java:283)
at java.net.URLClassLoader.access$000(URLClassLoader. java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java: 197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 07)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 48)
- 03-10-2011, 12:13 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 03-10-2011, 12:15 PM #5
Member
- Join Date
- Mar 2011
- Posts
- 20
- Rep Power
- 0
Similar Threads
-
Program will not compile?
By vtecjerry in forum New To JavaReplies: 1Last Post: 09-29-2010, 10:20 PM -
my program cannot be compile
By justlynn in forum NetBeansReplies: 8Last Post: 08-17-2010, 10:11 AM -
My Java program will not compile and run?
By sabrown311313 in forum Java AppletsReplies: 1Last Post: 09-23-2008, 09:38 AM -
Program Won't Compile
By JavaLovenJoe in forum New To JavaReplies: 2Last Post: 04-22-2008, 01:31 PM -
Compile a program
By toby in forum New To JavaReplies: 2Last Post: 07-30-2007, 09:09 AM


LinkBack URL
About LinkBacks

D

Bookmarks