Solved

enumish

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

713 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