[java-l] Singletone enum with Two Methods

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.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2012 Toolbox.com and message author.
Toolbox.com 4343 N. Scottsdale Road Suite 280, Scottsdale, AZ 85251
CharlesChemai  
 
View this online
Ask a new question
 
In the Spotlight
Earn Recognition for Your Contributions at Toolbox for IT. Gain Points for Community Achievements

_.____.__

No comments:

Post a Comment