Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Nested Enums

807589Sep 26 2008 — edited Sep 30 2008
Hope someone out there can either tell me the following is not possible or point me in the right direction...

I am trying to create nested enums, in the most trivial sense the following would be ideal:
public enum Databases implements Database{
	
	Oracle(DummyTables),
	MySQL(DummyTables);
	
	
	private static final Tables;
	
	private Databases(Enum Tables){
		this.Tables = Tables;
	}
	
	public Tables getTables(){
		return Tables;
	}
}

public enum DummyTables implements Tables{
	Employee,
	Permissions;
}

public interface Database{
	public Tables TABLES();
}

public interface Tables{}
Clearly this in not complete as I did not provide any methods in the Tables interface, but I hope you get the picture...
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 28 2008
Added on Sep 26 2008
4 comments
1,027 views