Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


vramanjikota
enum
1 Answer(s)      2 years and 5 months ago
Posted in : Java Beginners


why we are not created child for enum type? why we are not extending any from enum?


Advertisement
View Answers

May 30, 2012 at 6:15 PM


An enum can be declared outside or inside a class, but can not be declared in a method. Only public or default modifier can be used by the declaration of a top-level enum. You can use public, default, protected or private modifier on the declaration of a nest enum. All of enum type are subclasses of java.Lang.Enum, since Java does not support multiple inheritance, an enum cannot extend anything else.



Related Tutorials/Questions & Answers:
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
Advertisements
enum php mysql
enum php mysql  How to use mysql enum in php
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
need ENUM examples
need ENUM examples  i need enum sample examples   Hi Friend, Visit Here Thanks
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
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 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
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
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
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
Java error class interface or enum excepted
Java error class interface or enum excepted... or enum excepted are the class of java error that occurred when a programmer... java error class or enum excepted ,For this we have a class
SCJP Module-1 Question-25
Given a sample code: 1    class Test { 2    public enum Man { 3    RAJ, SURAJ, DINESH, GUYS     }; 4    public static void main(String[] args) { 5 
SCJP Module-1 Question-13
Given a sample code: enum Year { JANUARY, FEBUARY, MARCH, APRIL, MAY, JUNE, JULY } class EnumTest { Year year; public EnumTest(Year year) { this.year = year; } public void tellItLikeItIs() { switch (year) { case JANUARY
Java - Java Beginners
Java enum class tostring  An example of Java enum class tostring
java - Java Beginners
Java enum valueof string  How to get a value of enum into string in Java
JAVA
JAVA  I got another error like class,interface or enum Excepted
Enumeration in java
of predefined constants. The enum variable must equal to one of the values... they are constants and the values of enum are in upper case. In Java you can define an enum by enum keyword. public enum direction {NORTH, SOUTH, WEST, EAST
contains for list in struts2 - Struts
contains for list in struts2  Is there any way to check in the list or for existence of an enum ? Something like list.contains(string). iterating over list I want to do something like Display x display y
enumerations in java - Java Beginners
. It provides Compile-time type safety.For each enum type,a namespace has been... name.Typesafe constants(Enum) aren't compiled into clients, so you can add, reorder... arbitrary fields and methods to an enum class.An enum type implements the arbitrary
java - Java Beginners
java  where do i declare an enum?  Hi Friend, Please visit the following link: http://www.roseindia.net/java/master-java/enum.shtml Thanks
Java - Java Beginners
Java  Please help me with the following program! Thanks! 2. construct 2 enum classes, the first for the 7 colors; and the second for menu options: add, delete, update and quit. Then write an interactive program that creates
Classes and Objects
of classes within other classes, enum and annotations. Classes.... Enum Types:  Enum is a keyword which was introduced... objects which are members of that enum. The super class of all enum objects
Classes and Objects
to cover nesting of classes within other classes, enum and annotations. Classes...; Enum Types:  Enum is a keyword which was introduced... objects which are members of that enum. The super class of all enum objects
collection frame - Java Interview Questions
). (4)Enumerations: The enum keyword creates a typesafe, ordered list of values... enum pattern). (5)Swing: New skinnable look and feel, called synth. Varargs
jdk 1.5 features - Java Interview Questions
) and primitive wrapper classes (such as Integer). (4)Enumerations: The enum keyword... or manually constructed classes (typesafe enum pattern). (5)Swing: New
Error while SQL Server connection to Java
or enum is expected How to fix
Advertisements
 

 

 

DMCA.com