View Single Post
  #1 (permalink)  
Old 01-02-2008, 06:03 PM
bugger bugger is offline
Senior Member
 
Join Date: Nov 2007
Posts: 111
bugger is on a distinguished road
Constructor with enum
I have the following class:

Code:
public class GTent{ enum ttype{RANGE,LENGTH}; int length; ttype blockType; public GTent(int i, int j, ttype t) { this.length= i + j; this.blockType = t; }
In some other class, I want to create an object of it. I am not sure how to supply enum value to the constructor. Please advice.
Reply With Quote
Sponsored Links