Hey all,
I just finished taking a four day Java course and so I'm trying to refresh and I'm getting some errors. I wrote a very simple class that is supposed to find volume:
class findVolume {
public static void main (String args[]) {
if (args.length != 3) {
System.out.println("Please give me a value for Length, Width and Depth.");
}
else {
computeVolume(args[0], args[1], args[2]);
}
public static int computeVolume(int argLength, int argWidth, int argDepth) {
int myLength = argLength;
int myWidth = argWidth;
int myDepth = argDepth
int myVolume = argLength * argWidth * argDepth;
return myVolume;
}
}
}
Unfortunately, I'm getting two errors:
findVolume.java:10: illegal start of expression
public static int computeVolume(int argLength, int argWidth, int argDepth) {
^
findVolume.java:17: ';' expected
}
^
2 errors
Can anyone help?
Thanks,
- MT
I just finished taking a four day Java course and so I'm trying to refresh and I'm getting some errors. I wrote a very simple class that is supposed to find volume:
class findVolume {
public static void main (String args[]) {
if (args.length != 3) {
System.out.println("Please give me a value for Length, Width and Depth.");
}
else {
computeVolume(args[0], args[1], args[2]);
}
public static int computeVolume(int argLength, int argWidth, int argDepth) {
int myLength = argLength;
int myWidth = argWidth;
int myDepth = argDepth
int myVolume = argLength * argWidth * argDepth;
return myVolume;
}
}
}
Unfortunately, I'm getting two errors:
findVolume.java:10: illegal start of expression
public static int computeVolume(int argLength, int argWidth, int argDepth) {
^
findVolume.java:17: ';' expected
}
^
2 errors
Can anyone help?
Thanks,
- MT