From 31f634c63721f4db6380acd55b4b223a6c9f4de6 Mon Sep 17 00:00:00 2001 From: Caleb Fontenot Date: Fri, 2 Feb 2024 15:12:56 -0600 Subject: [PATCH] absolute bruh moment --- .gitignore | 2 + .../MP1_ManyToMany_CalebFontenot/pom.xml | 14 ++ .../ManyToMany.java | 114 +++++++++++ .../ManyToManyFactory.java | 182 ++++++++++++++++++ .../nbactions.xml | 55 ++++++ .../Multithreading_CalebFontenot/pom.xml | 39 ++++ .../FlashText.java | 86 +++++++++ .../PrintChar.java | 59 ++++++ .../RunFlash.java | 15 ++ .../multithreading_calebfontenot/Threads.java | 29 +++ .../forkbomb.java | 20 ++ 11 files changed, 615 insertions(+) create mode 100644 Semester 4/Assignments/MP1_ManyToMany_CalebFontenot/pom.xml create mode 100644 Semester 4/Assignments/MP1_ManyToMany_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/mp1_manytomany_calebfontenot/ManyToMany.java create mode 100644 Semester 4/Assignments/MP1_ManyToMany_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/mp1_manytomany_calebfontenot/ManyToManyFactory.java create mode 100644 Semester 4/Assignments/Multithreading_CalebFontenot/nbactions.xml create mode 100644 Semester 4/Assignments/Multithreading_CalebFontenot/pom.xml create mode 100644 Semester 4/Assignments/Multithreading_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/multithreading_calebfontenot/FlashText.java create mode 100644 Semester 4/Assignments/Multithreading_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/multithreading_calebfontenot/PrintChar.java create mode 100644 Semester 4/Assignments/Multithreading_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/multithreading_calebfontenot/RunFlash.java create mode 100644 Semester 4/Assignments/Multithreading_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/multithreading_calebfontenot/Threads.java create mode 100644 Semester 4/Assignments/Multithreading_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/multithreading_calebfontenot/forkbomb.java diff --git a/.gitignore b/.gitignore index c27dd3b..bc44d97 100644 --- a/.gitignore +++ b/.gitignore @@ -203,3 +203,5 @@ /Semester 4/Assignments/HashMapASDV_Ant/nbproject/private/ /Semester 4/Assignments/HashMapASDV_Ant/build/ /Semester 4/Assignments/HashMapASDV_Ant/dist/ +/Semester 4/Assignments/MP1_ManyToMany_CalebFontenot/target/ +/Semester 4/Assignments/Multithreading_CalebFontenot/target/ diff --git a/Semester 4/Assignments/MP1_ManyToMany_CalebFontenot/pom.xml b/Semester 4/Assignments/MP1_ManyToMany_CalebFontenot/pom.xml new file mode 100644 index 0000000..3e39986 --- /dev/null +++ b/Semester 4/Assignments/MP1_ManyToMany_CalebFontenot/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + edu.slcc.asdv.caleb + MP1_ManyToMany_CalebFontenot + 1.0-SNAPSHOT + jar + + UTF-8 + 20 + 20 + edu.slcc.asdv.caleb.mp1_manytomany_calebfontenot.MP1_ManyToMany_CalebFontenot + + \ No newline at end of file diff --git a/Semester 4/Assignments/MP1_ManyToMany_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/mp1_manytomany_calebfontenot/ManyToMany.java b/Semester 4/Assignments/MP1_ManyToMany_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/mp1_manytomany_calebfontenot/ManyToMany.java new file mode 100644 index 0000000..c9c85cb --- /dev/null +++ b/Semester 4/Assignments/MP1_ManyToMany_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/mp1_manytomany_calebfontenot/ManyToMany.java @@ -0,0 +1,114 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package edu.slcc.asdv.caleb.mp1_manytomany_calebfontenot; + +/** + * + * @author caleb + */ +import java.util.List; +import java.util.Set; + +/** + * + * @author A. V. Markou + * @param + * @param + */ +public interface ManyToMany +{ + /** + * Creates a Many to Many relationship between the parentLeft and the + * childrenRight. Example for ( Many1 a, Many2 1, 2, 3) it creates --> (a 1) + * ( a 2 ) ( a 3 ) and ( 1, a ), ( 2, a ), ( 3, a). No duplicate values of + * Many2 are allowed. + * + * @param parentLeft - exactly one Many1 object. + * @param childrenRight - one or more Many2 objects. + * @return the previous value associated with Many1, or null if there was no + * Many1 with the same "key". + * @throws ClassCastException - if the class of the specified Many1, or + * Many2 or value prevents it from being stored in this map( i,e Many1 is + * String and you pass an object) + * @throws NullPointerException - if the specified Many1 or Many2 is null + * and ManyToMany does not permit nulls as values. + * @throw IllegalArgumentException - if a duplicate exists in childrenRight + * list ( s1 --> p1,p2,p2 is not allowed). + * @return the previous value associated with parentLeft, or null if there + * was no childrenRight for parentLeft. + */ + List add(Many1 parentLeft, Many2... childrenRight); + + /** + * Returns the List of all left children of the parentRight. + * + * @param parentRight a parent at the RHS of the many to many relationship. + * @return the List of all left children of the parentRight. + * @throw IllegalArgumentException if the value of parameter parentRight + * does not exist in the RHS of the many to many relationship. + */ + List getChildrenLeft(Many2 parentRight); + + /** + * Returns the List of all right children of the parentLeft. + * + * @param parentLeft a parent at the LHS of the many to many relationship. + * @return the List of all right children of the parentLeft. + * @throws IllegalArgumentException if the value of parameter parentLeft + * does not exist on the LHS of the many to many relationship. + */ + List getChildrenRight(Many1 parentLeft); + + /** + * Returns a set of the Many1 elements that exist on the LHS of the many to + * many relationship. + * + * @return Set of Many1 + */ + Set getParentsLeft(); + + /** + * Returns a set of the Many2 elements that exist on the RHS of the many to + * many relationship. + * + * @return Set of Many2 + */ + Set getParentsRight(); + + /** + * Removes the many1 parameter from the LHS of the many relationship AND all + * its corresponding values that exist in the RHS of the many to many + * relationship. For example given: ( LHS e1: p1, p2 e2: p2, p3 RHS: p1: e1 + * p2: e1, e2 p3: e2 after removing e1 from the LHS will results into: ( LHS + * e2: p2, p3 RHS: p2: e2 p3: e2 + * + * @param many1 the unique element on the LHS to be removed. + * @throws NullPointerException if parameter many1 is null. + * @return true if the removal occurred, false if many1 does not exist in + * the LHS of the many to many relationship. + */ + boolean removeLeft(Many1 many1); + + /** + * Removes the many1 parameter from the RHS of the many relationship AND all + * its corresponding values that exist in the LHS of the many to many + * relationship. For example given: LHS e2: p2, p3 RHS: p2: e2 p3: e2 after + * removing p2 from the RHS will results into: LHS e2: p3 RHS p3: e2 + * + * + * @param many2 the unique element on the LHS to be removed. + * @throws NullPointerException if parameter many1 is null. + * @return true if the removal occurred, false if many1 does not exist in + * the LHS of the many to many relationship. + */ + boolean removeRight(Many2 many2); + + /** + * Clears all. + * + */ + void clear(); +} + diff --git a/Semester 4/Assignments/MP1_ManyToMany_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/mp1_manytomany_calebfontenot/ManyToManyFactory.java b/Semester 4/Assignments/MP1_ManyToMany_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/mp1_manytomany_calebfontenot/ManyToManyFactory.java new file mode 100644 index 0000000..14794bf --- /dev/null +++ b/Semester 4/Assignments/MP1_ManyToMany_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/mp1_manytomany_calebfontenot/ManyToManyFactory.java @@ -0,0 +1,182 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package edu.slcc.asdv.caleb.mp1_manytomany_calebfontenot; + +/** + * + * @author caleb + */ +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * + * @author asdv5 + */ +public class ManyToManyFactory { + + public static //generic types to be used in the method + ManyToMany< Many1, Many2>//return type + createManyToMany() + { + return new ManyToMany() { + private HashSet parents = new HashSet(); + + private Map left = new HashMap(); + private Map right = new HashMap(); + + @Override + public String toString() + { + return "{" + "left=" + left + ", right=" + right + '}'; + } + + /** + * Creates a Many to Many relationship between the parentLeft and the childrenRight. Example for ( Many1 a, Many2 1, 2, 3) it creates --> (a 1) ( a 2 ) ( a 3 ) and ( 1, a ), ( 2, a ), ( 3, a). No duplicate values of Many2 are allowed. + * + * @param parentLeft - exactly one Many1 object. + * @param childrenRight - one or more Many2 objects. + * @return the previous value associated with Many1, or null if there was no Many1 with the same "key". + * @throws ClassCastException - if the class of the specified Many1, or Many2 or value prevents it from being stored in this map( i,e Many1 is String and you pass an object) + * @throws NullPointerException - if the specified Many1 or Many2 is null and ManyToMany does not permit nulls as values. + * @throw IllegalArgumentException - if a duplicate exists in childrenRight list ( s1 --> p1,p2,p2 is not allowed). + * @return the previous value associated with parentLeft, or null if there was no childrenRight for parentLeft. + */ + @Override + public List add(Many1 parentLeft, Many2... childrenRight) + { + List returnList = new ArrayList(); + // Check to see if values already exist in this many to many object + if (this.left != parentLeft && this.left != null) { + returnList.add((Many2) this.left); + this.left = (Map) parentLeft; + } + if (this.left != childrenRight && this.right != null) { + returnList.add((Many2) this.right); + this.left = (Map) childrenRight; + left.put(parentLeft, Arrays.asList(childrenRight)); + + } + } + + @Override + public List getChildrenLeft(Many2 parentRight) + { + throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + } + + @Override + public List getChildrenRight(Many1 parentLeft) + { + throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + } + + @Override + public Set getParentsLeft() + { + throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + } + + @Override + public Set getParentsRight() + { + throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + } + + @Override + public boolean removeLeft(Many1 many1) + { + throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + } + + @Override + public boolean removeRight(Many2 many2) + { + throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + } + + @Override + public void clear() + { + throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + } + }; + } + + public static void main(String[] args) throws InterruptedException + { + ManyToMany mm = ManyToManyFactory.createManyToMany(); + //mm.add(1, 1);///will not compile, we have Many1, Many2 as String + System.out.println("add(e1, p1, p2)returns: " + mm.add("e1", "p1", "p2")); + System.out.println("add(e2, p2, p3)returns: " + mm.add("e2", "p2", "p3")); + System.out.println("getParentsLeft returns: " + mm.getParentsLeft()); + System.out.println("getParentsRight returns: " + mm.getParentsRight()); + System.out.println("getChildrenLeft(p1) returns: " + mm.getChildrenLeft("p2")); + System.out.println("getChildrenLeft(p2) returns: " + mm.getChildrenLeft("p3")); + System.out.println("getChildrenRight(e1) returns: " + mm.getChildrenRight("e1")); + System.out.println("getChildrenRight(e1) returns: " + mm.getChildrenRight("e2")); + System.out.println("-----------------------------------------------"); + System.out.println("The internal hash maps of ManyToMany after insertions: " + mm); + + System.out.println("----------AFTER REMOVAL of e1 LEFT----------------------------------------"); + System.out.println("removeLeft(e1) returns: " + mm.removeLeft("e1")); + System.out.println("getParentsLeft returns: " + mm.getParentsLeft()); + System.out.println("getParentsRight returns: " + mm.getParentsRight()); + System.out.println("getChildrenRight(e2) returns: " + mm.getChildrenRight("e2")); + System.out.println("getChildrenLeft(p2) returns: " + mm.getChildrenLeft("p2")); + System.out.println("getChildrenLeft(p3) returns: " + mm.getChildrenLeft("p3")); + System.out.println("The internal hash maps of ManyToMany after removal LEFT: " + mm); + + System.out.println("\n----------AFTER REMOVAL of p2 RIGHT----------------------------------------"); + System.out.println("removeLeft(p2) returns: " + mm.removeRight("p2")); + System.out.println("getParentsLeft returns: " + mm.getParentsLeft()); + System.out.println("getParentsRight returns: " + mm.getParentsRight()); + System.out.println("getChildrenRight(e2) returns: " + mm.getChildrenRight("e2")); + System.out.println("getChildrenLeft(p3) returns: " + mm.getChildrenLeft("p3")); + System.out.println("--------------------------------------------------"); + System.out.println("mm.removeLeft(e1) returns: " + mm.removeLeft("e1")); + + System.out.println("The internal hash maps of ManyToMany after removal RIGHT: " + mm); + Thread.sleep(5000, 0); + + System.out.println("---------------CATCHING EXCEPTIONS -----------------------------------"); + try { + mm.getChildrenRight("e10");//e10 dos not exist + } catch (RuntimeException e) { + System.err.println("getChildrenRight for e10 throws exception:" + e); + } + try { + System.out.println(mm.add("e6", new String[]{ + "value1", null + })); + } catch (RuntimeException e) { + System.err.println("add(e6, new String[]{null } ) throws exception: " + e); + } + try { + System.out.println(mm.add(null, "p1")); + } catch (RuntimeException e) { + System.err.println("add(null, p1)returns throws exception: " + e); + } + try { + System.out.println(mm.getChildrenLeft("p1")); + } catch (RuntimeException e) { + System.err.println("getChildrenRight(p1) throws exception: " + e); + } + try { + mm.add((String) new Object(), (String) new Object()); + } catch (RuntimeException e) { + System.err.println("add((String) new Object(), (String) new Object()) throws exception: " + e); + } + mm.clear(); + System.out.println("-----------------------------------------------"); + System.out.println("The internal hash maps of ManyToMany after clear: " + mm); + + } +} diff --git a/Semester 4/Assignments/Multithreading_CalebFontenot/nbactions.xml b/Semester 4/Assignments/Multithreading_CalebFontenot/nbactions.xml new file mode 100644 index 0000000..300244a --- /dev/null +++ b/Semester 4/Assignments/Multithreading_CalebFontenot/nbactions.xml @@ -0,0 +1,55 @@ + + + + run + + jar + + + process-classes + org.codehaus.mojo:exec-maven-plugin:3.1.0:exec + + + + ${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs} + + ${packageClassName} + java + + + + debug + + jar + + + process-classes + org.codehaus.mojo:exec-maven-plugin:3.1.0:exec + + + -agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address} + ${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs} + + ${packageClassName} + java + true + + + + profile + + jar + + + process-classes + org.codehaus.mojo:exec-maven-plugin:3.1.0:exec + + + + ${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs} + ${packageClassName} + java + + + + diff --git a/Semester 4/Assignments/Multithreading_CalebFontenot/pom.xml b/Semester 4/Assignments/Multithreading_CalebFontenot/pom.xml new file mode 100644 index 0000000..f5566d5 --- /dev/null +++ b/Semester 4/Assignments/Multithreading_CalebFontenot/pom.xml @@ -0,0 +1,39 @@ + + + 4.0.0 + edu.slcc.asdv.caleb + Multithreading_CalebFontenot + 1.0-SNAPSHOT + jar + + + org.openjfx + javafx + 20 + pom + + + org.openjfx + javafx-graphics + 20 + linux + + + org.openjfx + javafx-controls + 20 + linux + + + org.openjfx + javafx-maven-plugin + 0.0.4 + + + + UTF-8 + 17 + 17 + edu.slcc.asdv.caleb.multithreading_calebfontenot.Multithreading_CalebFontenot + + \ No newline at end of file diff --git a/Semester 4/Assignments/Multithreading_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/multithreading_calebfontenot/FlashText.java b/Semester 4/Assignments/Multithreading_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/multithreading_calebfontenot/FlashText.java new file mode 100644 index 0000000..9622551 --- /dev/null +++ b/Semester 4/Assignments/Multithreading_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/multithreading_calebfontenot/FlashText.java @@ -0,0 +1,86 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package edu.slcc.asdv.caleb.multithreading_calebfontenot; + +/** + * + * @author caleb + */ +import javafx.application.Application; +import javafx.application.Platform; +import javafx.scene.Scene; +import javafx.scene.control.Label; +import javafx.scene.layout.StackPane; +import javafx.stage.Stage; + +public class FlashText extends Application +{ + private String text = ""; + @Override // Override the start method in the Application class + + public void start(Stage primaryStage) + { + StackPane pane = new StackPane(); + Label lblText = new Label("Programming is fun"); + pane.getChildren().add(lblText); + + Thread t1 = new Thread( + new Runnable() + { + public void run() + { + try + { + while (true) + { + if (lblText.getText().trim().length() == 0) + text = "Welcome"; + else + text = ""; + + + + Platform.runLater( + new Runnable() + { + @Override + public void run() + { + lblText.setText(text); + } + }); + +/* + + Thread t2 =new Thread( new Runnable() { + @Override + public void run() + { + lblText.setText(text); + } + }); + */ + Thread.sleep(300); + } + } + catch (InterruptedException ex) + { + } + } + }); + t1.start(); + + // Create a scene and place it in the stage + Scene scene = new Scene(pane, 200, 50); + primaryStage.setTitle("FlashText"); // Set the stage title + primaryStage.setScene(scene); // Place the scene in the stage + primaryStage.show(); // Display the stage + } + + public static void main(String[] args) + { + launch(args); + } +} \ No newline at end of file diff --git a/Semester 4/Assignments/Multithreading_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/multithreading_calebfontenot/PrintChar.java b/Semester 4/Assignments/Multithreading_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/multithreading_calebfontenot/PrintChar.java new file mode 100644 index 0000000..16282bd --- /dev/null +++ b/Semester 4/Assignments/Multithreading_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/multithreading_calebfontenot/PrintChar.java @@ -0,0 +1,59 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package edu.slcc.asdv.caleb.multithreading_calebfontenot; + +/** + * + * @author caleb + */ +public class PrintChar implements Runnable{ + + private char charToPrint; + private int times; + + public PrintChar(char charToPrint, int times) + { + this.charToPrint = charToPrint; + this.times = times; + } + + + @Override + public void run() + { + for (int i = 0; i < times; ++i) { + System.out.println(charToPrint); + } + } + + public static void main(String[] args) + { + for (int i = 0; i < 1000; ++i) { + System.out.println("lmao"); + } + } +} + +class PrintNum implements Runnable { + private int lastNum; + + public PrintNum(int lastNum) + { + this.lastNum = lastNum; + } + + public void run() + { + for (int i = 1; i <= lastNum; ++i) { + System.out.print(" " + i); + Thread.yield(); + if (i % 10 == 0) { + System.out.println(); + } + } + } + + +} diff --git a/Semester 4/Assignments/Multithreading_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/multithreading_calebfontenot/RunFlash.java b/Semester 4/Assignments/Multithreading_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/multithreading_calebfontenot/RunFlash.java new file mode 100644 index 0000000..833e3aa --- /dev/null +++ b/Semester 4/Assignments/Multithreading_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/multithreading_calebfontenot/RunFlash.java @@ -0,0 +1,15 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package edu.slcc.asdv.caleb.multithreading_calebfontenot; + +/** + * + * @author caleb + */ +public class RunFlash { + public static void main(String[] args) { + FlashText.main(args); + } +} diff --git a/Semester 4/Assignments/Multithreading_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/multithreading_calebfontenot/Threads.java b/Semester 4/Assignments/Multithreading_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/multithreading_calebfontenot/Threads.java new file mode 100644 index 0000000..9587b56 --- /dev/null +++ b/Semester 4/Assignments/Multithreading_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/multithreading_calebfontenot/Threads.java @@ -0,0 +1,29 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package edu.slcc.asdv.caleb.multithreading_calebfontenot; + +/** + * + * @author caleb + */ +public class Threads { + public static void main(String[] args) + { + // Create tasks + Runnable printA = new PrintChar('a', 100); + Runnable printB = new PrintChar('b', 100); + Runnable print100 = new PrintNum(100); + + // Create threads + Thread thread1 = new Thread(printA); + Thread thread2 = new Thread(printB); + Thread thread3 = new Thread(print100); + + // Start threads + thread1.start(); + thread2.start(); + thread3.start(); + } +} diff --git a/Semester 4/Assignments/Multithreading_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/multithreading_calebfontenot/forkbomb.java b/Semester 4/Assignments/Multithreading_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/multithreading_calebfontenot/forkbomb.java new file mode 100644 index 0000000..1ad2d36 --- /dev/null +++ b/Semester 4/Assignments/Multithreading_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/multithreading_calebfontenot/forkbomb.java @@ -0,0 +1,20 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + */ + +package edu.slcc.asdv.caleb.multithreading_calebfontenot; + +import java.io.IOException; + +/** + * + * @author caleb + */ +public class forkbomb +{ + public static void main(String[] args) throws IOException + { + Runtime.getRuntime().exec(new String[]{"java", "-cp", System.getProperty("java.class.path"), "forkbomb"}); + } +} + \ No newline at end of file