Question from CharlesChemai on Apr 30 at 4:44 AM I have A Singletone enum with two methods public void createList() and public void sayHello(), and a SingletoneImpl Class with main as Singleton.INSTANCE.createList( );and Singleton.INSTANCE.sayHello( ); Why do I get error reached end of file while parsing? 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"); } } 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( ); { } | Reply to this email to post your response. __.____._ | _.____.__ |
No comments:
Post a Comment