Click to See Complete Forum and Search --> : Error??? help please!!! :]


nirali666
March 23rd, 2008, 10:33 PM
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());
}
}

banie
March 24th, 2008, 02:20 AM
Did you declare IntClass? Or you want to use wrapper class?


IntClass second, fourth;

keang
March 24th, 2008, 07:28 AM
There isn't an IntClass in the standard jdk, did you mean to use the class Integer.

nirali666
March 24th, 2008, 09:42 AM
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?

Londbrok
March 24th, 2008, 10:02 AM
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.