Enum questions

Can someone explain these program.
1. In IsFlagDefined method  when i print e.ToString() it prints different outputs on each iteration.I am not able to understand the logic behind the output can someone explain me step by step.Also i am not able to reply to others it always says 
Body text cannot contain images or links until we are able to verify your account.
Please help me on these too.
static bool IsFlagDefined (Enum e)
decimal d;
Console.WriteLine(e.ToString());
return !decimal.TryParse(e.ToString(), out d);
[Flags]
public enum BorderSides { Left=1, Right=2, Top=4, Bottom=8 }
static void Main()
for (int i = 0; i <= 16; i++)
BorderSides side = (BorderSides)i;
IsFlagDefined (side);

Hi SriNath,
1) For the problem of message "Body text cannot contain images or links until we are able to verify your account. " you need to verify your account by clicking the link in email send by MSDN forums.
Once you verify your account you are able to put link and images in your post.
2) It's easy if you pass Left it will shows 1, for right 2, top 4 and bottom 8. It's giving a sum of ENUM.
For example if i = 3 it prints left + right (1+ 2) = 3
so it's easy.
and if you want to post code in your post please use code dialog so we can read it easily.
Hope it helps.
Thanks,
Nans11
ENjoy ThE WorLD Of COdE

Similar Messages

  • Int to enum question

    I have an old program, the method take an int as parameter, in side the method, I check each int value and take action like:
    switch(i)
    case Const.A: ...
    case Const.B: ...
    Const is a class defined sone constant values like
    static final int A = 1;
    static final int B = 2;
    now, I would like to change Const to a enum. define A, B as enum's elements. but i don't want to change method's parameter, which means the method still take int as parameter. how can I map the passed in int to each enum element

    now, I would like to change Const to a enum. define
    A, B as enum's elements. but i don't want to change
    method's parameter, which means the method still take
    int as parameter. how can I map the passed in int to
    each enum elementWhy are you not able (or desiring) to change the method to accept an enum parameter?
    One way to get the enum's ordinality is to use the ordinal method. This is kind of the converse to what jverd was showing you.
        myMethod(myEnum.ordinal()); //changes enum to its integerBut as jverd states, best to use enums as enums and integers as integers.

  • Enum Question

    Hi,
    Just looking for a bit of advice on this piece of code. My main method involves the user entering the size in inches. Based on this I want to calculate the appropriate enum value based on their entry. Is the getSize() method below the only way to do this using an enum?
    (I realize I could use an array etc but I'm just looking to try out enums)
    public enum JerseySize {
         XL("42-44"),
         L("38-41"),
         M("36-37"),
         S("33-35");
         private String inInches;
         JerseySize(String i){
              this.inInches = i;
         public static JerseySize getSize(String s)
              for(JerseySize js : JerseySize.values())
                   if (js.inInches.equals(s))
                        return js;
              return null;
    }

    It's almost always better to keep information in as specific a type as you can. So for a whole number of inches, use an int rather than a string. For two such numbers, you can use two ints, or - in this specific case - you know the max is one less than the min of the next, you could iterate through the values to get it. So I'd use JerseySize(int minInches, int maxInches) and have a boolean contains (int inches) method.

  • Quick enum question

    When comparing enum values: it's ok to use the == comparator, right?

    When comparing enum values: it's ok to use the ==
    comparator, right?Correct.
    Kaj

  • Class design question: Can you have an enum of class objects?

    Hi, thank you for reading this post!
    We all know that an enum represents a set of constants, but sometimes a class has a restricted set of values as
    well. My question is can we have an enum of objects.
    Example:
    We have a class named Coin
       A coin with a monetary value.
    public class Coin implements Measurable
       private double value;
       private String name;
       public Coin(double aValue, String aName)
          value = aValue;
          name = aName;
       public double getValue()
          return value;
       public String getName()
          return name;
       public double getMeasure()
          return value;
    }We all know that a coin has a set of values "Dollar" = 1.00, "Quarter" = 0.25, "Dime" = 0.10, "Nickel" = 0.05, and
    "Penny" = 0.01.
    Can we have an enum of Coins with Coin as a class at the same time?
    If yes, how do we do this?
    Thank you in advance for your help!
    Eric

    Maybe you want something like this:
    public enum Coin implements Measurable {
         DOLLAR(1.00, "Dollar"),
         QUARTER(0.25, "Quarter"),
         DIME(0.10, "Dime"),
         NICKEL(0.05, "Nickel"),
         PENNY(0.01, "Penny")
         private double value;
         private String name;
         Coin(double aValue, String aName)
              value = aValue;
              name = aName;
         public double getValue()
              return value;
         public String getName()
              return name;
         public double getMeasure()
              return value;
    }

  • Design Question enums etc

    Ok. So I have a class that represents a symbol. A symbol can have many values associated with it e.g name, description, type etc
    I have a BaseSymbol which contains a map, which I'm intending to use to store the values associated with a symbol ( as above ) rather than having explicit fields associated with the symbol.
    So
    BaseSymbol implements ISymbol ( top level interface )
    I have a method on ISymbol named getField.
    here lies my problem. I originally had getField accept a string as an argument which i then use to access the map to get the appropriate variable. I then have a set of static final strings that represent all possible values for fields within a symbol
    e,g usage:
    public static final String DESC = "Description"
    ISymbol s = new BaseSymbol() - Inside my constructor I set the DESC field to be something like 'This is a symbol'
    s.getField(DESC) - returns me ''This is a symbol'
    Anyway. I hate the class typing ( using strings ) that go along with this model.
    I need a BaseSymbol to have it's map keyed by a safely Typed class rather than a string ( So someone can't pass in an invalid field name )
    I started using Enums, but fell short as I want to the extend field options for the future
    e.g
    Enum SymbolField { CODE, DESC }
    Enum ExtraSymbolFields extends SymbolField { EXTRAFIELD1, EXTRAFIELD2 }
    Now as you can't do this with Java enums I am interested to hear about any other possible approaches / thoughts?? I was maybe thinking about using a version of the old type safe enum pattern ( which can allow for class extention )?
    Your advice is appreciated.

    interface Symbol {
      String getSymbol();        
    interface ExtraSymbol extends Symbol {
      String getDescription();
    enum BasicSymbol implements Symbol {
      DOLLAR("$");
      private final String symbol;
      private BasicSymbol(String symbol) {
        this.symbol = symbol;
      @Override
      public String getSymbol() {
        return symbol;
    enum ExtendedSymbol implements ExtraSymbol {
      DOLLAR("$", "US Dollar");
      private final String symbol;
      private final String description;
      private ExtendedSymbol(String symbol, String description) {
          this.symbol = symbol;
          this.description = description;
      @Override
      public String getSymbol() {
          return symbol;
      @Override
      public String getDescription() {
          return description;
    }Then you can do:
    public <T extends Enum<T> & Symbol> void getSymbol(Class<T> symbolSet) {
        for (Symbol symbol : symbolSet.getEnumConstants()) System.out.println(symbol.getSymbol());
    public <T extends Enum<T> & ExtraSymbol> void getSymbolAndDesc(Class<T> symbolSet) {
        for (ExtraSymbol symbol : symbolSet.getEnumConstants()) System.out.println(symbol.getSymbol() + " : " + symbol.getDescription());
    }And:
    getSymbol(BasicSymbol.class);
    getSymbol(ExtendedSymbol.class);
    getSymbolAndDesc(ExtendedSymbol.class);

  • Help: a question about the Enum......

    Hi,
    Now I defined a Enum like below:
    public enum Seasons {  
    winter&#65292; spring&#65292; summer&#65292; fall  
    }  and here below is testing code
    System.out.println(Seasons.winter);  the console will print 0.
    Now I have a variable, its value is 2, so it should be mapping to Seasons.summer
    int idx = 2;but how to write the code to get the Seasons.summer?

    you can't (easily)
    and you shouldn't
    the whole point is that enumerations are abstract; you shouldn't be able to use them like integers and do arithmetic on them
    what are you doing that will require this?
    if you really wanted to, the Class class has a method called getEnumConstants() which returns an array of the enum objects in order of their ordinal value; so you could do something like
    Seasons.class.getEnumConstants()[2]Edited by: spoon_ on Dec 18, 2007 2:11 AM

  • JPA2 Question: Is it possible to map a Map(enum, List String ) in JPA2?

    Is it possible to map a Map(enum, List<String>) in JPA2? Or do I have to create a separate Entity class that maps each List<String> collections for each possible value in the enum?
    Edited by: user7976113 on Jan 22, 2010 7:51 PM
    Edited by: user7976113 on Jan 22, 2010 7:51 PM

    No, JPA does not support this or any nested collection type of mappings directly.
    The best solution is to create an Entity or Embeddable to contain the collection data.
    See,
    http://en.wikibooks.org/wiki/Java_Persistence/Relationships#Nested_Collections.2C_Maps_and_Matrices
    James : http://www.eclipselink.org

  • Enum size question

    The following code compiles with gcc but not the Sun compiler:
    #include <limits.h>
    enum a  { aA = ~(1<<10) } ;
    enum b  { bA  = ULONG_MAX } ;
    enum c  { cA = ~(1<<10), cB  = ULONG_MAX } ;
    CC -c -m32 test.cpp"test.cpp", line 4: Error: c is not within the range of a long or unsigned long.
    From a quick browse, it appears gcc enums are of type unsigned but Sun enums are signed. But if that is the case the above is rather confusing:
    - firstly the error message does not indicate which member of c is causing the problem
    - the error is ambiguous. What is the limit, is it long or unsigned long? If the latter I believe it should be ok. The fact the error says "or unsigned long" means that must be an option - if so, can I enable enums to be of type unsigned somehow?
    - Why does it give me an error for enum c but not a or b, which contain the same values?
    Our code is full of enums using ~x and using unsigned UINT_MAX values, so this looks like it could be a showstopper for us in our Sun compiler evaluation. Any information is appreciated.

    Sun C++ follows the C++ standard (refer to section 7.2).
    An enumeration type has an underlying type that is large enough to hold all the enumeration values. The type shall not be larger than int unless the value won't fit in an int or unsigned int. Other possible underlying types include long and unsigned long.
    In this case, the enumeration values are -1025 and ULONG_MAX. That range of values cannnot be represented in a 32-bit environment by type long (can't represent ULONG_MAX) or unsigned long (can't represent a negative value). The error message does not point to either value because either one is OK by itself -- the combination is not OK.
    Experimenting with g++ shows that it uses type long long for the underlying type, a non-standard language extension. Sun C++ does not support enums larger than long or unsigned long.
    To make your code conform to the requirements of the C++ Standard, you must restrict the range of the enum values. Depending on whether you intend ~(1<<10) to be treated as negative or as unsigned, two choices are enum c  { cA = unsigned(~(1<<10)) ,  cB  = ULONG_MAX } ;
    enum c  { cA = ~(1<<10) ,    cB  = LONG_MAX } ;

  • Question about scope in the enum example in the Java Tutorial

    Hi,
    On page http://java.sun.com/docs/books/tutorial/java/javaOO/enum.html of the Java tutorial the enumeration MONDAY is not prefixed with the enum name when it is used in the function tellItLikeItIs.
    public class EnumTest {
         Day day;
         public EnumTest(Day day) {
              this.day = day;
         public void tellItLikeItIs() {
              switch (day) {
                   case MONDAY: System.out.println("Mondays are bad.");
                                  break;
                   case FRIDAY: System.out.println("Fridays are better.");
                                  break;How does the compiler know that MONDAY is the same as Day.MONDAY? Is it because of
    switch(day)Then later in the main MONDAY must be prefixed with Day. I removed Day. and it did not compile. Why is Day. necessary in main but not in tellItLikeItIs?
    public static void main(String[] args) {
              EnumTest firstDay = new EnumTest(Day.MONDAY);
              firstDay.tellItLikeItIs();Thank you.

    swtich is a special case.
    The label for each 'case' of a switch
    will infer based on the type of switch value
    switch(d) {
    case MONDAY:
    case TUESDAY:
    will automatically refer to the MONDAY and TUESDAY
    corresponding to d's type.

  • Question about enum

    What can I do to make this work? HAPPY isnt a variable so it returns a
    "cannot find symbol error". I don't think I am understanding enum
    completely here...
    enum Emote {HAPPY, SAD, BORING}
    public void change() {
    shift(HAPPY);
    public void shift(Emote e) {
    do(something, e);
    }

    enum Emote {HAPPY, SAD, BORING}
    public void change() {
    shift(HAPPY);
    public void shift(Emote e) {
    do(something, e);
    }Of course, how can we say what is HAPPY...?
    You should qualify the constant with its Enum ..something like say, Emote.HAPPY
    I suggest you look at some intro to Java Enums...(i too am new to it..let me also take a look !! :) )
    http://java.sun.com/docs/books/tutorial/java/javaOO/enum.html
    Best wishes,
    "raghu"
    //[email protected]

  • Stupid Question: export enum to csv?

    I will be putting together a rather large statemachine, the state will be annunciated on an HMI via ModbusTCP.
    That HMI has a tool 'Message Display' that looks up a text string to display from an integer value.
    I would like to avoid having to keep this display in sync manually with a large enum typdef that I will be constantly editing, so I was poking around in labview, with another, smaller, enum typedef hoping there was some means of getting the item list (as seen when you edit items) into excel, for cut-n-pasting into the HMI's tool.
    Don't see it. Anything built in?
    I suppose I could write something to run on my development machine....anyone done this already - perhaps?
    From an item list to a csv or text or xls file??
    Solved!
    Go to Solution.

    Or use "GetNumericInfo.vi" found in vi.lib\utility\VariantDataType.  Wire in an enum, get out an array strings containing the enumeration names.  Has the advantage that it doesn't require access to the front panel and works on RT.  I once wrote a little VI that used this to automatically generate a C header file containing enumeration values to keep the C and LabVIEW code in synch.

  • Question on bounding generic with Enum

    Consider an enum that implements some interface:
    public enum Blah implements Bleh
    //I can now make a class like this:
    public class Foo<T extends Enum<T>>
    // The compiler has no problem so far.
    // But if I do this:
    public class Foo<T extends Enum<T> & bleh>
    The compiler gives this error:
    classes cannot directly extend java.lang.Enum
    What have I done wrong?
    -Eric

    It takes more than 10 minutes to show up. More like a
    week. Be patient. I just cut and pasted this thread.You responded so fast I thought the bug was already known. I hope this
    can be fixed in the next release because I think it will be a very useful
    bounding technique for enums.
    -Eric

  • Question Enum

    I want to know what is the difference b/w enum and Enum....
    In the below mentioned codepackage forTesting;
    //corresponds to
    //enum Season { WINTER, SPRING, SUMMER, FALL }
    public final class EnumExample2 {
    private EnumExample2(String name, int ordinal) { super(name,ordinal); }
    public static final EnumExample2 WINTER = new EnumExample2("WINTER",0);
    public static final EnumExample2 SPRING = new EnumExample2("SPRING",1);
    public static final EnumExample2 SUMMER = new EnumExample2("SUMMER",2);
    public static final EnumExample2 FALL   = new EnumExample2("FALL",3);
    private static final EnumExample2[] VALUES = { WINTER, SPRING, SUMMER, FALL };
    public static EnumExample2[] values() { return VALUES.clone(); }
    public static EnumExample2 valueOf(String name) {
    for (EnumExample2 e : VALUES) if (e.name().equals(name)) return e;
    throw new IllegalArgumentException();
    }it throws an exption at private EnumExample2(String name, int ordinal) { super(name,ordinal); } saying that the constructor is not defined. Can someone please explain why this is so...

    How can I make this class correspond to the below
    code
    enum Season { WINTER, SPRING, SUMMER, FALL }..By not calling that non-existent constructor, and instead have those two arguments assigned to instance variables

  • A rather long post of me talking gibberish and asking LOTS of questions.

    ================================================== ================================================== ===
    Before reading this MASSIVE post, please read the bottom at the stupid amount of P.P.S.'s as they probably have a lot of information that I forgot to put in the middle or something.
    ================================================== ================================================== ===
    Hi, I'm some guy on the internet and I am 15 years old. For the sake of this post and the answers I hope to have, please ignore my age and understand my maturity and I hope that you can understand why I would like to learn this language so much. I seem to have major issues with learning this language and online tutorials and stacks of books do not seem to do the trick. Please do not reply saying "this is not for you, try something else" because although I do not know much in Java in terms of making good applications, I have learned quite a few things and I am able to make simple things with the console such as making a calculator where the user has to type in what operator they want to use and then they are asked to enter two numbers in which they are timed/added/divided etc. together and it gives the answer. Considering this I really want to continue learning this language because I find it fun to learn and fun to program in, yet I am having serious stress issues because I can't understand simple things and I just forget some of them and I then find it difficult to make simple applications. For example, I am trying to make a simple snake game where you have to find all the apples and eat them and then your body grows larger etc. but I just can't think of how I would do it. I know a few simple application type things and maybe how to put them to use, but I just don't know how to use them in this situation and how to start off making games like these.
    Just to tell you a little bit about my background of programming, I have known about programming since I was about 11, I made a virus in Visual Basic believe it or not. It would disguise itself as Mozilla Firefox and would slowly delete random files that were opened or edited in the last month starting from the last used files in said month. It would delete a set amount of files every time you booted up and it was pretty nasty. It was obviously quite easy to get rid of it and it probably had many bugs, but it was a nasty virus nonetheless. Anyway, that lasted around 2 months and I never really picked up on programming until around 13 at which point I learned a bit of Java up until the System.out.println part, so not very far at all and I barely understood anything. Then I kinda picked it up at 14 last summer (2012) and learned almost as much I know now over the summer holidays and then kind of left it until after Christmas because I couldn't really get past a certain 'barrier' so I got bored and gave up. Until now. After Christmas I got back into it and starting learning a few more things, understood functions a little more and downloaded a bunch of source code from lots of different websites. I've now been extremely stressed out for the past 2 weeks going crazy because I can't fit anything else into my head because I just forget it or just don't understand it. So I am now in a complete frenzy not doing homework, being a douche to my friends and just not being very social or doing stupid things.
    Unfortunately this is going to be a rather long post as you can probably already tell and there will be a 20 Q's kind of 'game' below where I ask things that I desperately need to know and maybe things that I want to know but don't necessarily need to know.
    If you can, I would greatly appreciate it if you could answer all of the first 14 questions in one post instead of 1 or 2. Also, please do not post anything unnecessary or nasty as I am a new poster here and I just want to get started in Java and I have my own reasons for starting at such a young age and my intentions are rather personal. So please treat this matter with maturity and I hope someone can really help me.
    I am sorry for any misspellings or grammatical errors, I am fully English, I am just rubbish at spelling.
    THE QUESTIONS!!!
    1) What is SUPER used for, when should I use it and why should I use it?
    2) When making a new class and you type PUBLIC [insert class name here](){} what does this do and why does it need to be the same name as the class it is in?
    3) Why do you need to make new classes inside already made classes sometimes?
    4) What is the use of NEW and why do you need to use it when you are creating something like a JFrame, where for example you would use it in your main function and have NEW [insert name of function with JFrame inside]();, why can't you just do [insert name of function with JFrame inside]();?
    5) What is actionPerformed, where is it used and why should I use it?
    6) When using a function, what is achieved when you call another class and make another variable inside said function? Eg, public [insert class name here]([insert other class name here][insert new variable name here]){}
    7) What 'type' is an ENUM? Is it an int? String? Double? So if I were to make ENUM [insert name of enum here] {A, B, C, D, E, F, G}; So what would happen if I were to say PUBLIC [insert name of enum here] B = 5; what would that mean? Would that assign it as an integer?
    8) When should I use enums, what is the point in them?
    9) What does [inset object here].ORDINAL mean? What is it used for and when should I use it?
    10) Although I understand that the RETURN statement is used to end a function and return it with a value if there is one specified, but when it returns it with that value that you may have specified, what happens to that value, how do I retrieve it and how do I use it? When will I know when to use RETURN?
    11) Briefly explain how to use KeyEvent, getKeyCode and just anything else to do with accepting user input and how I would use it.
    12) When using the KeyAdapter, why do you need to make a new class inside an already made class? What does this achieve? Why can you not extend it on the current class you are using instead of making a new class? This links back to the 3rd question.
    13) What is the difference between ++object and object++? Does it really matter which way I use them? Why should I use them differently and how will it affect my code if I use them differently?
    14) What's the difference between an IF statement and a BOOLEAN statement? They are both booleans and if used correctly can be used to do the exact same thing with just one or two lines of codes difference. Which one should I pick over the other and why? Which one is better to use for what kind of things?
    ================================================== ================================================== ===
    POINTLESS QUESTIONS THAT I JUST FEEL LIKE ASKING THAT DON'T NEED TO BE ANSWERED AND DON'T HAVE MUCH TO DO WITH THE CODE ITSELF
    ================================================== ================================================== ===
    15) What is the best way to get into the mindset of 'a programmer'? What is the best way to understand the ways in which you would build an application and learning the step by step processes so you know what you have to do next and how to do it.
    16) I seem to always be worried that it takes programmers 5 minutes to program a very simple game, like Tetris because I've seen videos and just other places where it makes it look like it takes them a very small amount of time to make something that might take me months to learn. Is this how it works? Or can it take hours to program 5 classes for a very simple game? If so, why does it, if said programmer hypothetically understands the language well enough to make said program? Surely they would know what to do and how to make it so it would not take long at all?
    17) How often are IF and ELSE statements used in common programs? I feel when I am making a program I am always using them too much and I just stop programming from there because I feel that I am using too much of something so maybe it isn't the right way to do it or maybe there is a better way to do it.
    18) What would be the best way to learn programming for someone who finds it difficult to teach himself said topic yet has no efficient way to have someone teach him? I feel I am somewhat intelligent enough to learn a programming language, I have gotten this far, so I feel I should just keep going. Besides, despite the difficulties I have and the ridiculous amount of stress I get from not being able to learn on my own, I find it very entertaining to program things, read over other peoples code and slowly learn the world of programming. I feel that I see myself as a programmer in the future and I just really hope that I can learn this language quickly before I am too old to have time to learn this as a hobbie as I do now.
    19) I am someone who hopes to become a games developer as I thoroughly enjoy playing games as much as I do finding out how they work. What would be the right way about learning how to make games? Should I stick with Java or should I go to C++? I've only stuck with Java because I have more experience with it and I feel that I should learn an easy language and get used to OOP and other things before I go off making complex programs with a difficult language. I know how to print something to the console in C++ and that's about it.
    20) I have no way of having an education on programming in my school at the moment and all courses that have programming in them aren't very good - you make a simple application for coursework and you do a computer physics exam at the end of the year, not too helpful for me. Also, I don't have many friends that are diversed in any language of programming and the ones I do have, coincidentally, absolutely none of them are any good at making games or painting anything in graphics or anything to do with frames and windows. They're all about the console and making mods for games instead of making full on programs with a window and what not so it's difficult to get any of them to teach me anything. I've looked at college courses and none of them are for my age and what I am wanting, or they are just too damn expensive. I have also looked at online courses, one-to-one tutoring etc. but they are either way too expensive or they aren't very good in terms of being in a country half way across the world or maybe they have bad ratings. Anyway, what I'm trying to ask, despite all the negative put backs and all the issues that seem to follow me whenever I try to learn this damn language, what would be the best way to teach myself this language or any other language, or where are the best places to have someone teach me for free/cheap prices? I just essentially want to make something basic like a video game like Tetris or something so I at least have some knowledge of making a video game so I can maybe learn other things much easier.
    P.S. I am in top sets for all my classes at school, so any intelligence issues aren't a part of this. I guess you could maybe call it laziness, but I just prefer to say that I am too used to people teaching me things and doing things for me rather than teaching and doing things myself. So if I were stuck on an island alone I really would not know what to do at all because I would mainly rely on other people.
    P.P.S. Just for anyone's curiosity, I use Eclipse as my IDE on a Windows 7 Ultimate OS.
    P.P.P.S. I am British.
    P.P.P.P.S. I have read through about 4 books about Java, but on most of them I just get really bored and stop reading them half way through because they either don't explain what I want to know or they really suck at explaining what I want to know.
    P.P.P.P.S If you are going to post a good tutorial, please post one that I have most likely NOT been on. PLEASE. I have gone through MANY tutorials which all of them don't do me any favours. Please post one that you think that I might not have seen and actually tells me what EACH line of code does and WHY it does it and WHY I might use it and WHERE I might use it. Etc.
    P.P.P.P.P.S If this is a TL;DR kind of post, then I am awfully sorry to have bored you, please go onto another post, but thank you very much for taking the time to actually LOOK and CLICK on my post. However if you do not have any intention of helping my dilemma, please leave as although I am asking for A LOT for FREE, I really don't need pointless posts that really do not solve my problem. Thanks.
    P.P.P.P.P.P.S (Last P.P.S I swear! I just keep forgetting things.) If you have any questions to ask or I might not have asked something properly, feel free to ask as I will probably be refreshing this page non-stop for the next 2 weeks. Thanks ^^
    For all the people out there who are THAT awesome to post here answers to these questions, I really salute to you and I would VERY gladly give you money for your time and effort, if I had the funds to give you what it's worth. ;-)
    Edited by: 983242 on 21-Jan-2013 16:26

    Before reading this MASSIVE postI didn't read it. I went straight to the questions. The rest of it was a complete waste of your time. Nobody cares whether you are 15, are stressed, get bored, etc. You should spend more time learning and less time emoting, and typing.
    I am rubbish at spelling.So fix that. If you stay in this business you will have to spell properly or get nowhere. Compilers won't accept mis-spellings: why should anybody else? Get over it. In a few years you will have to write a resume. If I get it and it is misspelt it goes in the bin.
    1) What is SUPER used for, when should I use it and why should I use it?It is used for two purposes that are described in the Java Language Specification. If you can't read language specifications you will have to learn, or get nowhere. You can't learn languages in forums.
    2) When making a new class and you type PUBLIC [insert class name here](){} what does this do and why does it need to be the same name as the class it is in?That's two questions. 'public' is used for a purpose that is described in [etc as above]. The class name needs to agree with the file name because that is a rule of Java. Period. There's a reason for the rule but you should be able to discover it for yourself eventually, and it doesn't actually matter what the reason is at this stage in your development.
    3) Why do you need to make new classes inside already made classes sometimes?Why not?
    4) What is the use of NEW and why do you need to use it when you are creating something like a JFrame, where for example you would use it in your main function and have NEW [insert name of function with JFrame inside]();, why can't you just do [insert name of function with JFrame inside]();?Meaningless. You have to use the language the way it was designed. Same applies to most if not all your questions.
    5) What is actionPerformed, where is it used and why should I use it?See the Javadoc.
    6) When using a function, what is achieved when you call another class and make another variable inside said function? Eg, public [insert class name here]([insert other class name here][insert new variable name here]){}I cannot make head or tail of this question. You could try making it intelligible.
    7) What 'type' is an ENUM?It is of type Enum.
    Is it an int? String? Double?No, no, and no.
    So if I were to make ENUM [insert name of enum here] {A, B, C, D, E, F, G}; So what would happen if I were to say PUBLIC [insert name of enum here] B = 5; what would that mean? Would that assign it as an integer?I'm getting sick of this [insert name here] business. Try making your questions legible and intelligible. And again, an enum is not an int.
    8) When should I use enums, what is the point in them?When you want them. Not a real question.
    9) What does [inset object here].ORDINAL mean?Nothing. There is no such construct in Java. There might be an occasional class with a public variable named ORDINAL, in which case it means whatever the guy who wrote it meant. If you're lucky he documented it. If not, not.
    10) Although I understand that the RETURN statement is used to end a function and return it with a value if there is one specified, but when it returns it with that value that you may have specified, what happens to that value, how do I retrieve it and how do I use it?You store it in a variable, or pass it to another function, or use it as a value in a statement, for sample as an if or while condition.
    When will I know when to use RETURN?Err, when you want to return a value?
    11) Briefly explain how to use KeyEvent, getKeyCode and just anything else to do with accepting user input and how I would use it. In a forum? You're kidding. Read the Javadoc. That's what I did.
    12) When using the KeyAdapter, why do you need to make a new class inside an already made class?You don't.
    13) What is the difference between ++object and object++?This is all described in the Java Language Specification [etc as above] and indeed most of this stuff is also in the Java Tutorial as well. Read them.
    Does it really matter which way I use them?Of course, otherwise they wouldn't both exist. Language designers are not morons.
    Why should I use them differently and how will it affect my code if I use them differently?That's just the same question all over again.
    14) What's the difference between an IF statement and a BOOLEAN statement?The difference is that there is no such thing as a boolean statement.
    POINTLESS QUESTIONSThanks for stating that.
    THAT I JUST FEEL LIKE ASKINGBad luck. I don't feel like answering pointless questions. Ever.

Maybe you are looking for

  • I've lost all my events and photos in iPhoto

    Recently converted to all things Mac. I use iphoto to categorise all my photos and events and faces, basically everything. I then use Aperture to create projects and import from my iphoto library the selected photos I want to work with only. For some

  • Info about "with" statement..

    Hi everybody, I have seen too many threads using with statements in sql... The general syntax is : SQL> with t as ( select ...... from ..... union select ...... from ..... )...... 'test' from t; What is this and where can I found info about this.....

  • Can i use Access 2000 for my JDBC program?

    I tried to run a JDBC program from a book and it worked. The problem is, it uses an outdated "Informix" database. I want to do it in Access 2000. Is it possible? Please give me a sample code if you have guys. Thanks Moses

  • Tutorial on DOI(Desktop Office Integration) For MAcros run in Excel

    Hi, I need some tutorials Where i can see how we can run macros from our program to Excel using DOI method, Please i already tried to find on internet but no valuable result have found, Please do the needful. I need tutorial of DOI only. WArm Regards

  • I got a Bookmark bar without Bookmarks! How can I see them?

    <blockquote>Locking duplicate thread.<br> Please continue here: [/questions/817046]</blockquote><br> I installed the new firefox. I realy like it. But there is one thing. I have my bookmark bar on. But there are no bookmarks on it :( Is there anyway