Solved

enumish

Posted on 1998-08-16
2
173 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Weekend adv creator 3 36
why cannot we forward request once the response is committed 2 42
factorial example 4 39
spring jars download 1 26
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

806 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