Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

enumish

Posted on 1998-08-16
2
Medium Priority
?
198 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
mjenkins earned 200 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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

688 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