I get this error:
The type java.io.FilterOutputStream cannot be resolved. It is indirectly referenced from required type java.io.PrintStream
in this block of code:
public class MalyTest {
private Integer i = 3;
public void doRoboty() {
System.out.println(i);
}
}
Error disappear once I try to print something else like in this block of code:
public class MalyTest {
private Integer i = 3;
public void doRoboty() {
System.out.println("Hello");
}
}
What is the reason?
>Solution :
Your variable i is not a String. Try to do this:
System.out.println(i.toString());
or
System.out.println("Variable i value is: " + i);