|
-
March 23rd, 2008, 10:33 PM
#1
Error??? help please!!! :]
ok...here's the code, and the error says:
cannot find symbol class IntClass
Code:
import java.util.*;
import java.io.*;
public class ex
{
static Scanner console = new Scanner(System.in);
public static void main (String[] args)
{
int first, third;
IntClass second, fourth;
first = 3;
second = new IntClass(4);
third = 6;
fourth = new IntClass(7);
System.out.println(first + " " + second.getNum() + " " + third + " " + fourth.getNum());
getData(first, second, third, fourth);
System.out.println(first + " " + second.getNum() + " " + third + " " + fourth.getNum());
fourth.setNum(first * second.getNum() + third + fourth.getNum());
getData(third, fourth, first, second);
System.out.println(first + " " + second.getNum() + " " + third + " " + fourth.getNum());
}
public static void getData(int a, IntClass b, int c, IntClass d)
{
a = console.nextInt();
b.setNum(console.nextInt());
c = console.nextInt();
d.setNum(console.nextInt());
b.setNum(a * b.getNum() - c);
d.setNum(b.getNum() + d.getNum());
}
}
-
March 24th, 2008, 02:20 AM
#2
Re: Error??? help please!!! :]
Did you declare IntClass? Or you want to use wrapper class?
Code:
IntClass second, fourth;
-
March 24th, 2008, 07:28 AM
#3
Re: Error??? help please!!! :]
There isn't an IntClass in the standard jdk, did you mean to use the class Integer.
-
March 24th, 2008, 09:42 AM
#4
Re: Error??? help please!!! :]
I think so, but this was a problem from my workbook and i was suppose to figure out the output, but this keeps showing up, how do i declare it?
-
March 24th, 2008, 10:02 AM
#5
Re: Error??? help please!!! :]
You dont. Unless you find IntClass specified somewhere in your course material and take it from there. Are you sure this is a coding excercise and not some brains-and-paper-only level mindwork?
If you are convinced that you are supposed to figure this out by code, then either use int, or its wrapper class Integer, or... then your course material should have some indication of what intClass actually is.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|