class cc extends Thread {
cc(String s) {
super(s);
}
}
class mainn {
public static void main (String args[]) {
cc t1 = new cc("first");
t1.start();
}
}
Question: Is the thread born
- at this point –>
cc t1 = new cc("first"); - or is it born and started at this point –>
t1.start();?
“Born” is not a formal term that I’ve seen before in Java, relating to threads.
The Thread object is constructed/instantiated/created when you call
new cc("first").The thread itself is started when you call
t1.start(). It still exists before then, but is not running, and will not be scheduled by the operating system.(P.S. Java naming conventions are that class names start with capitals – it is surprisingly confusing to read code that violates this.
new cc(...)jumps out at me as somehow wrong.)