How many threads being created?
java, multithreading
Solution
Since your simple program does not create threads explicitly only one application thread is created here. This is the "correct" short answer at the interview.
However you can continue and say that JVM creates other threads it needs for itself. For example garbage collector (GC) thread. Number of GC threads depends on configuration. By default 1.
Problem
In one of the interview i came across query on threads.Question is in the below code snippet, how many threads are being created? I know it's seems to be very basic query. But i couldn't find answer with proof. Could someone provide me answer with the concept(any links)? Thanks in anticipation. ``` class MainApp { public static void main(String[] args) { System.out.println("Welcome to Java"); } } ```