need ENUM examples

Ads

 
 

Share on Google+Share on Google+

Ashok Reddy Yelti
need ENUM examples
1 Answer(s)      7 years ago
Posted in : Java Beginners

i need enum sample examples

Ads
View Answers

October 22, 2010 at 12:20 PM


Hi Friend,

Try the following code:

public class EnumExample
{
  public enum Languages{
    C, Java, DOTNET, PERL
  }

  public static void main(String[] args){
    int i = 1;
    for (Languages lang: Languages.values())
    {
      System.out.printf("Languages %s = %s\n", i++, lang);
    }
  }
}

For more information, visit the following link:

http://www.roseindia.net/java/master-java/enum.shtml

Thanks


Ads









Related Tutorials/Questions & Answers:
need ENUM examples
need ENUM examples  i need enum sample examples
need ENUM examples
need ENUM examples  i need enum sample examples   Hi Friend, Visit Here Thanks
Advertisements
need ENUM examples
need ENUM examples  i need enum sample examples   Hi Friend, Visit Here Thanks
need ENUM examples
need ENUM examples  i need enum sample examples   Hi Friend, Try the following code: public class EnumExample { public enum Languages{ C, Java, DOTNET, PERL } public static void main(String[] args){ int
enum
enum  HOW TO INSERT enum constants at runtime into the enum
enum
enum  why we are not created child for enum type? why we are not extending any from enum
enum
enum  enum concept is developed based on class concept,but we can extend any class from our class,but why it is not passiable to extend by enum? every class in java directly and indirectly child class of Object class,every enum
Need Jar in the JPA examples
Need Jar in the JPA examples  JPA - tutorial is good, very easy to understand and simple. But to run the examples, the jar/helping files are needed. and how Hibernates are used in the JPA example? Thnaks Abhijit Das   
enum php mysql
enum php mysql  How to use mysql enum in php
about enum - Java Beginners
about enum  hi all, please tell me about "enum" and explain with example. And its use in OOP. Thanks
Enum Type
Enum Type       Enum... of that enum. The super class of all enum objects is java.lang.Enum, apart from this enum can not be extended. There is another important feature that is every enum
Enum data type
Enum data type  How can we use enum data type in java program?   Example enum Fruits { APPLE(10), ORANGE(3), MANGO(5), LICHHI(10...() + ")"); } } Result Display APPLE(10) Description:- In this example we are using enum
ENUM Types
ENUM Types A Enum type consist of a fixed set of constants. In java, you define an enum type by using the enum keyword. For example, you would specify a months-of-year enum type as: public enum Year{ January,February,March
How to get enum value in Java
How to get enum value in Java  Hi all, i am looking for a solution to get an enum value from index in Java. Please suggest. Thanks
examples
examples  Hi sir...... please send me the some of the examples... questions .   Hello Friend, Which type of connectivity examples do you want?Please clarify this. Thanks   mysql connectivity examples  
difference between enum and final class?
difference between enum and final class?  what is the difference between enum and final class in java?   The java.lang.Enum is an abstract.... The definition of Enum is: public abstract class Enum> extends Object implements
need
need  i need a jsp coding based project plz help me
Inserting a value to an Enum field in Table
Inserting a value to an Enum field in Table  I'm writing a code..., password varchar (10), is_Admin enum('Y','N'), In the Java code I have a user... this enum field in the table
Version of com.shamanland>xdroid-enum-format dependency
List of Version of com.shamanland>xdroid-enum-format dependency
Need Project
Need Project  How to develop School management project by using Struts Framework? Please give me suggestion and sample examples for my project
Maven Dependency xdroid-enum-format >> 0.2.4
You should include the dependency code given in this page to add Maven Dependency of com.shamanland >> xdroid-enum-format version0.2.4 in your project
Maven Dependency xdroid-enum-format >> 0.2.5
You should include the dependency code given in this page to add Maven Dependency of com.shamanland >> xdroid-enum-format version0.2.5 in your project
Maven Dependency xdroid-enum-format >> 0.2.6
You should include the dependency code given in this page to add Maven Dependency of com.shamanland >> xdroid-enum-format version0.2.6 in your project
Maven Dependency xdroid-enum-format >> 0.3.0
You should include the dependency code given in this page to add Maven Dependency of com.shamanland >> xdroid-enum-format version0.3.0 in your project
Enum Data Types
Enum Data Types       Enum type is a type which consist of fixed set of constant fields. like direction... take an example of enum data types:   EnumTestResult.java
Ajax Examples
Ajax Examples       There are a few AJAX demos and examples on the web right now. While these are invaluable to learning AJAX, some people need a bit more information than just
PHP Examples
In this section of PHP examples, the new bees will learn the basic examples of most common used functions. These examples will help to the experts too... examples from several functions to sessions, class and objects. The examples
HTML5 examples
examples to learn in detail with the help of many examples. Please provide me the urls of HTML5 examples. Thanks   Hi, There are many new features... supported by major browsers. View examples at HTML5 Examples tutorial page
Need of ORM
Need of ORM  Why do you need ORM tools like hibernate
need of code
need of code  howto convert greyscale image to binary image in java
need coding
need coding  sir i need code for simple bank application in jsp please send it   sir i need the coding for simple bank application in jsp.   Please visit the following link: Jsp Bank Application

Ads

 
Advertisement null

Ads