Solved

enumish

Posted on 1998-08-16
2
154 Views
Last Modified: 2010-03-30
Is there a way to get values (final statics) assigned without the work - like a c enum thing?

work
interface IFace {
  int a = 1;
  int b = 2;
  int c = 3;
}

no work (no work)
interface IFace {
  int a = 1;
  int b;
  int c;
}
0
Comment
Question by:hank1
2 Comments
 
LVL 3

Accepted Solution

by:
mjenkins earned 50 total points
ID: 1219301
IF you just want an "enum" type and are not specifically concerned with the values, you can:

public final class Enum
{
      public static final Enum A = new Enum();
      public static final Enum B = new Enum();      
      public static final Enum C = new Enum();      
      public static final Enum D = new Enum();
}


0
 
LVL 1

Author Comment

by:hank1
ID: 1219302
Wanted ints but understand Java cannot do this.  Thanks.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
The viewer will learn how to implement Singleton Design Pattern in Java.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now