A quick disclaimer before I begin my question- the last couple of times I've asked a Java question here I've been flamed. I realise that Java is the scum of the earth and there are much better languages to pick. I know. I'm constrained by my university. Just answer the question please, or stay quiet- please don't waste my time.
To the question: I have methods called by other methods and I want to check if they are actually doing their thing- quickly and easily, using System.out.println(). I want to know if there are issues with helper methods printing to the commandline/terminal or if there is something seriously wrong with my code. Since this is for homework I won't post my actual code, but the code to do with where the issue is.
Code:
public class MyClass
public MyClass() { //generic constructor.
}
public buildThis() {
//take an input and build it into the data stucture.
int foo = usefulMethodWhichReturnsInt();
System.out.println("This prints fine."); //1
}
public usefulMethodWhichReturnsInt() {
System.out.println("Will this print?"); //2
return 0;
}
public static void main(String args[]) {
MyClass bar = new MyClass;
bar.buildThis();
System.out.println("This will also print."); //3
}
So yeah, will the usefulMethod be able to print something on the command line?
Thanks everyone in advance.
titanium_geek