/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package exempel1; /** * * @author karlssoj */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here new Tradtest(); } } class Tradtest implements Runnable { public Tradtest() { Thread nyTrad = new Thread(this); nyTrad.start(); loop1(); } public void loop1() { while(true) { System.out.println("detta är tråd nr 1\n"); } } public void run() { while(true) { System.out.println("detta är tråd nr 2\n"); } } }