Hi,
I have a little question and I hope its in the right section but well here it comes
today in class our professor “collected the homework” (what was a programm that takes decimal numbers and converts them to binary numbers). Well not very difficult but he told me i created a “dead object” by writing:
public class Converter {
public Converter() {
//do the algorithm etc..
}
public void otherFUnctions() {
//..
}
public static void main(String[] args) {
[b]new Converter();[/b]
}
}
He told me this is a bad behaviour of writing code and my algorithm should better be in the main method, than instantiating a dead object. He also didnt want to explain that to me and just said you’ll learn more about that when you learned how stacks are built.
I wonder now why this is so bad because i always see alot of ppl starting their code like this (even example code in books I’ve read is like that).
Since my prof didnt had the time or smth else ;D to explain that to me.
So I wanted to ask you guys, maybe someone can explain it
thx