Skip to content

Instantly share code, notes, and snippets.

@wzul
Created November 28, 2018 13:38
Show Gist options
  • Save wzul/b4eca76ceba5d1f6ef8ac40064fc43aa to your computer and use it in GitHub Desktop.
Save wzul/b4eca76ceba5d1f6ef8ac40064fc43aa to your computer and use it in GitHub Desktop.
Determine minimum expenses
package javaapplication1;
/**
*
* @author wanzu
*/
public class JavaApplication1 extends Thread {
static int minimum_expenses = 0;
@Override
public void run(){
minimum_expenses++;
}
public static void main(String[] args) {
Thread t[] = new Thread[10];
for (int i=0; i<t.length; i++){
t[i] = new JavaApplication1();
}
for (int i=0; i<t.length; i++){
t[i].start();
}
System.out.println(minimum_expenses);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment