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());
}
}
Re: Error??? help please!!! :]
Did you declare IntClass? Or you want to use wrapper class?
Code:
IntClass second, fourth;
Re: Error??? help please!!! :]
There isn't an IntClass in the standard jdk, did you mean to use the class Integer.
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?
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.