Hello multithreaded world

Well heres another solution to “Hello world”

public class HelloWorld {

static int counter;
static String[] letters= {“H”,”e”,”l”,”l”,”o”,” “,”m”,”u”,”l”,”t”,”i”,”t”,”h”,”r”,”e”,”a”,”d”,”e”,”d”,” “,”w”,”o”,”r”,”l”,”d”};

private HelloWorld(){ }
public static void main(String[] args){
counter=0;
HelloWorld hello = new HelloWorld();
hello.run() ;
} //main

public static int getCounter(){
return counter;

}// getcounter

public static void incCounter(){
counter++;
} // incounter

public static String getLetter(int i){
return letters[i];
} //getletter

void run(){
for(int i=0;i

Leave a Reply