3
I have a class that extends the Thread class, wanted to know if every time I create an object it initializes a Thread.
class Objeto{
String nomeObjeto;
public Objeto(String nomeObjeto){
this.nomeObjeto = nomeObjeto;
}
public static void main(String[] args){
new Objeto().start();//Objeto 1
new Objeto().start();//Objeto 2
}
}
Ahh, I forgot something in the code, this class extends the Thread class
– Yuri Melo
Only create object does not start to Thread you will need to call the method
Start()
as in the code you posted:new Objeto().start()
– ramaral