Hi, I am pretty new to Java. I have some basic questions.
public class Array {
private Object[] values;
private int count;
private boolean sorted;
public Array (int max) {
this.values = new Object[max];
this.count = 0;
this.sorted = true;
I am kinda confused at line 9. It looks like declaring an instance/instantiate because of the keyword new, but from what I have seen, we usually create an object in the driver/main class; we don't create it in the constructor. So is it doable? and why?
2. What is Stream IO? I know it is like input and output, but what exactly is it? What's the difference between IO.stdout.print and System.out.print?
public final class IO {
public static PrintStream stderr = System.err;
....}
What is stderr? I looked it up but the definition is too complicated to understand.
Thanks!