0

I have this Singleton class:

package com.CCharles.Singleton;
import java.util.ArrayList;



     public enum Singleton{

        INSTANCE;
         public void createList(){  
        ArrayList arrayList = new ArrayList();
        for(int i=1;i<101;i++)
        {

        arrayList.add("Job "+i);

        }
        for(int i=1;i<101;i++)
        {

        System.out.println(arrayList.get(3));

        }

        System.out.println("DONE");

        }

        public void sayHello(){

        System.out.println("Hello World");

    }   

    }

and I am accessing Using:

package com.CCharles.Singleton;
import com.CCharles.Singleton.Singleton;

   public class SingletonImpl implements Singleton{


     public static void main(String[]args){ 
    Singleton.INSTANCE.createList( );
    Singleton.INSTANCE.sayHello( );
    {



}

I wonder Why I can't be able to parse(I get compile error 'reached end of file while parsing').

2
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by Baduizm
0

Got IT! Also changed Line 4

public class SingletonImpl implements Singleton{

to

public class SingletonImpl {

Thank You I was starting to panik..

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.