Java Programming Tutorial - 44 - Enumeration

Поделиться
HTML-код
  • Опубликовано: 4 янв 2025
  • Source Code: github.com/the...
    Core Deployment Guide (AWS): docs.google.co...

Комментарии • 692

  • @Rahulbajaj561
    @Rahulbajaj561 5 лет назад +54

    to make the enum concept more clear for you guys:
    Difference between Enums and Classes
    An enum can, just like a class, have attributes and methods. The only difference is that enum constants are public, static and final (unchangeable - cannot be overridden).
    An enum cannot be used to create objects, and it cannot extend other classes (but it can implement interfaces).
    Why And When To Use Enums?
    Use enums when you have values that you know aren't going to change, like month days, days, colors, deck of cards, etc.

    • @aqib1602
      @aqib1602 4 года назад +1

      The last time I took a shower was
      8 months ago
      LMFAOO

    • @bonniesitessolutions7728
      @bonniesitessolutions7728 4 года назад +1

      @@aqib1602 It's 9 months now...LOL

    • @vathsan3906
      @vathsan3906 4 года назад +1

      @@bonniesitessolutions7728 11 months... lol

    • @Makwayne
      @Makwayne 3 года назад +1

      @@vathsan3906 2 years now

  • @amrnasser1992
    @amrnasser1992 10 лет назад +471

    hard one, Bucky ignores the fact that 90% of his subscribes don't have girlfriends.

    • @fairytail6804
      @fairytail6804 10 лет назад +16

      therefore we succeed! :(

    • @BobTheZealot
      @BobTheZealot 9 лет назад +4

      Look at my G+ profile and count my girl followers.

    • @tomj.
      @tomj. 9 лет назад +12

      +Bob The Zealot G+ followers don't count. :P

    • @BobTheZealot
      @BobTheZealot 9 лет назад +1

      NullChips oh lol

    • @rogernkosi8420
      @rogernkosi8420 9 лет назад +4

      +Amr Nasser hmmmm 99% i guess

  • @MrYeune
    @MrYeune 8 лет назад +272

    So Oracle is behind this... Java making woman into objects.

  • @ipwnpancakes910
    @ipwnpancakes910 9 лет назад +108

    1:54
    "...and lets go ahead and end that statement with a semi-colon"
    Just like your relationship with julia from the sound of it lol

  • @starfox300
    @starfox300 10 лет назад +42

    why do you always use gfs as variables, I don't have such thing

  • @bratpollution1371
    @bratpollution1371 10 лет назад +16

    Awesome video description, Greg

    • @doge8015
      @doge8015 10 лет назад +5

      I'm sure Greg doesn't like us using his real name. :D

  • @sergiualexandrugaga8653
    @sergiualexandrugaga8653 4 года назад

    I don't even know where to begin, I'm just super grateful that I found you, I just love the way you teach.
    My teacher from uni is kinda useless and it makes me cry sometimes, cause he would just assign impossible tasks for us.
    He usually expects us to modify the very complicated code that he wrote who knows how many years ago and this is super hard considering that we don't know Java, he always complicates things and doesn't know to explain at all.
    I just want to thank you from the bottom of my heart for these videos, I learned so much in such a short time!

  • @ryuzakilawliet930
    @ryuzakilawliet930 10 лет назад +142

    picture of kelsey or it didnt happen

  • @TylerZhangTZ
    @TylerZhangTZ 12 лет назад

    Bucky(parameters) is "in essence an object"
    Tuna myObject = new Tuna(); is creating a new object
    and returning is basically asking the method from another class to give you something.
    For example, you could do something like this:
    public class testing{
    public string test(){
    return "Hello";
    }
    }
    and in another class you called upon it using
    testing t = new testing();
    String A = t.test();
    then A would be equal to "Hello" because you set the variable to whatever the method gives you.

  • @pcbot17
    @pcbot17 11 лет назад +8

    Oh how badly I wish Julia sees this LOL.. Thanks for the humour man. It really helps while going through 100s of coding lessons :)

  • @MIO9_sh
    @MIO9_sh 7 лет назад +5

    Parameter names don't really need to be difference from local field names, as long as you know the "this" keyword

  • @budguesor9222
    @budguesor9222 4 года назад

    Unlike other tutorials where they show just basic enums without fields you actually chose to show an enum with 2 fields. That is why I like your videos

  • @KyleStacks
    @KyleStacks 5 лет назад +1

    god it shows how old this video is back in the day when there were 10 minute limits on youtube videos, now all we have in 2019 is 10 hour vids of Mr. Krabs saying "and the next day"

  • @RameenFallschirmjager
    @RameenFallschirmjager 5 лет назад

    Bucky, every once in a while I check your channel just to listen to your voice man. Where are you bro?! You are the only and the one king of youtube!

  • @gautambatra24
    @gautambatra24 12 лет назад

    This is what you said: "return = return a variable to the screen (Outputs the data of a variabe, or an array etc)"
    This is what it is: The return statement defines the result of the method. You can think of it as the "output of the method" whenever its called. For instance if a method is defined as:
    public int sum (int a, int b) {
    return (a+b);
    }
    and if you have a statement like this in main:
    int c=sum(2,3);
    Then whatever is returned by the method call is stored in c (5 in this case).

  • @SvdbendFILMS
    @SvdbendFILMS 9 лет назад

    Lolled at the bigmistake part, I love the humor u put into these vids. It makes it even more fun to watch

  • @connorbailey308
    @connorbailey308 7 лет назад

    never laughed out loud for that long while watching a java tutorial before... Subscribed. I'll be coming back here for all future java help for sure.

  • @gregthegreat162
    @gregthegreat162 13 лет назад

    This is the first of the tutorials that I've genially struggled to fully understand. Time to get a book to back up these excellent tutorials!!

  • @midnightcarsintokyo
    @midnightcarsintokyo 13 лет назад

    For all the 12 year olds out there, not to discourage you or anything, you're doing great work, I think it's amazing that you can understand this, but just a warning for the future, If you don't start learning the simpler languages, such as BASIC, XHTML, Javascript, PHP, Python and XML, you will end up with a programming mind that is warped beyond repair. When you get to University, and you choose to do Computer Science, you will have realised that the 9 years you were programming, you wasted.

  • @saby8765
    @saby8765 6 лет назад

    You pretty much nailed the concepts of enum, when you said these constants are basically classes with variables of their own. That's why I left a like to the video.

  • @kornelijekovac9793
    @kornelijekovac9793 10 лет назад +22

    You failed to explain the most important thing - what's the point of enumeration? Also what is being enumerated? Is enumeration used as a verb, describing a procedure of enumeration of contained subjects?

    • @harrynewton4786
      @harrynewton4786 10 лет назад +3

      he actually did explain it it is used for creating constants or values that u can have in handy

    • @harkamanghag6877
      @harkamanghag6877 10 лет назад

      The video has no point because the concept of enumeration cannot really be applied towards those three individuals.

  • @AMGrevolution
    @AMGrevolution 14 лет назад

    Wow! I've learned more from your tutorials in 1 day, then I have from my class in 1 week

  • @oskary9944
    @oskary9944 11 лет назад

    they can be the same all you need to do is
    "this.variable = variable"
    in this case
    "this.desc = desc"
    hope that answered your question still pretty new to java

  • @ItsTheJackpot
    @ItsTheJackpot 10 лет назад +27

    Funny how the first part of this tutorial series has over 3M views, and not even 10% made it to this video.

    • @PEDzzUK
      @PEDzzUK 9 лет назад

      What did you expect?

    • @ItsTheJackpot
      @ItsTheJackpot 9 лет назад +1

      DriftEDM Counter question, why do you reply. It adds nothing.

    • @PEDzzUK
      @PEDzzUK 9 лет назад

      The Jackpot Nice avoidance. I've just seen this comment so many times, so I thought to ask an opinion.

    • @1kalekip1
      @1kalekip1 9 лет назад +4

      The Jackpot Counter counter question: why do you reply?

    • @ItsTheJackpot
      @ItsTheJackpot 9 лет назад

      Kale Kip You think you're funny after 2 weeks? *mute*

  • @greenzally
    @greenzally 6 лет назад

    First video of Bucky's I've watched in a while that I actually understood without having to watch it 5 times! Back on track. Phew, those last few got a bit tough.

  • @90cdowns
    @90cdowns 13 лет назад

    Dude you are my hero, man thanks for all of the java and html knowledge that youve provided, its ganna really give me a leg up by time i get to college and decide to start my business.

  • @nimrodshoval6356
    @nimrodshoval6356 11 лет назад

    Your videos are great, Bucky.
    It's amazing you have so much knowledge at such a young age.

    • @ProBarokis
      @ProBarokis 5 лет назад +1

      and so much girlfriends

  • @MystVideos
    @MystVideos 9 лет назад +7

    You can and you should use the same name for both variables, for clarification purposes.
    The most local object is always used and you can access the other one with 'this'
    this.string = string;

    • @ActuallyAwesomeName
      @ActuallyAwesomeName 7 лет назад

      video is from 2009. maybe "this" operator wasnt implemented in java back then? just a guess, I'm new to java

    • @kommoo3366
      @kommoo3366 7 лет назад

      +SatoruNakata Nope, he made a tutorial on the "this" keyword before this one.

  • @Howtodothatshit
    @Howtodothatshit 12 лет назад

    and an enum type is a type whose fields consist of a fixed set of constants. Common examples include compass directions (values of NORTH, SOUTH, EAST, and WEST) and the days of the week.

  • @TOAST4005
    @TOAST4005 12 лет назад

    Based on how I understood it, the toString is used to take an object, and transfer it to a string. So say I have this "return String.format("My name is %s, my birthday is %s", name, birthday);" then, because it is a 'String' and you have an object in the string, then the object is automatically transfered into the toString() method. So, birthday is transfered into the "%d/%d/%d" I don't know if I helped at all, and I will probably have to watch them again. Just continue, it makes sense later.

  • @srincrivel1
    @srincrivel1 6 лет назад

    This was just way too good! Thanks man, wherever you are

  • @Nic1Nacs
    @Nic1Nacs 12 лет назад

    Its not exactly boring, its just a lot of stuff, I am still taken back from the toString tutorials, without a doubt I'll have to watch them again

  • @roccopietrofesa7914
    @roccopietrofesa7914 9 лет назад

    I'm so glad I found your channel. "Best channel ever" you may be right. Thank you so much for providing such great resources.

  • @TalonSenatu
    @TalonSenatu 11 лет назад

    I have Java exam at school tomorrow and I didn't get the part about Enum. But now I do. This helped me a lot! Thanks!

  • @庄硕-x5f
    @庄硕-x5f 5 лет назад

    Lovely Bucky!!!!nice to see you again!!!

  • @VicodinMA
    @VicodinMA 7 лет назад

    The way to avoid collision between the instance variables and the variables passed in to the constructor as parameters is by using the key word *this*
    private final String desc;
    private final String year;
    tuna(String desc, String year) {
    this.desc = desc;
    this.year = year;
    }
    *this* signifies it refers to the private fields or instance variables

  • @splitshadow13
    @splitshadow13 13 лет назад

    @fatalmystic You need to have a constructor to make those constant objects in the enum. Before he created the constructor, they had a red underline because java did not know how to make them.

  • @harrynewton4786
    @harrynewton4786 10 лет назад +12

    quick shortcut for everybody instead of writing System.out.println(); all in one go
    just go "sysout" then press ctrl + space

    • @mihaivigu2879
      @mihaivigu2879 6 лет назад +3

      and an even shorter is "syso" + ctrl+space

    • @selvoselvo1
      @selvoselvo1 5 лет назад +2

      @@mihaivigu2879 For quick getters creation, point your cursor in the constructor where they are declared ALT+SHIFT +S and choose from the menu (sometimes right or left alt shift works)

    • @-zero-
      @-zero- 5 лет назад +3

      for intellij users in 2019 just type sout and tab.

    • @bryaneverson1159
      @bryaneverson1159 5 лет назад

      @@mihaivigu2879 nice thanks

  • @datojokhadze7542
    @datojokhadze7542 9 лет назад +55

    in one of the previous tutorials,you've mentioned that Nicole was your 2nd gf :P

  • @LawenceCodye
    @LawenceCodye 15 лет назад

    man was this tutorial fun...wow...thanks * 44 for great tutorials...

  • @gautambatra24
    @gautambatra24 12 лет назад

    queque you're right, the basics are extremely similar, as both java and c++ are what are known as "object oriented" languages and knowledge of one definitely complements the other. Don't worry too much about howtodo's comments. I think that experience he quotes is in Mercury years.

  • @crazypigs100
    @crazypigs100 10 лет назад

    So happy u have a good mic. Thanks for video!

  • @dfsfklsj
    @dfsfklsj 12 лет назад

    Dude, you just answered my questions again! Thanks for being so helpful(currently learning polymorphism).

  • @turdubars
    @turdubars 8 лет назад +191

    Julia disliked this video 58 times

  • @LordJogaBonito
    @LordJogaBonito 12 лет назад

    That is indeed a good observation, though if you try to put public in there you get an error. I think that once thsi is an enum and not a class, the constructor can only have the modifier private, since it can't be public for some reason.

  • @rajkumarwadeyar6409
    @rajkumarwadeyar6409 6 лет назад

    Thank you sir. I really was not able understand this when I first started reading this topic. Now I know how it works.

  • @jiayang4839
    @jiayang4839 10 лет назад

    so much fun watching you video!

  • @thebigbang100
    @thebigbang100 12 лет назад

    The whole return thing is just the way you call a variable from another class when it is privated. So the method becomes the variable

  • @SirBrownsack
    @SirBrownsack 12 лет назад +1

    Found this type of code in minecraft in the EnumToolMaterial file. It has the types of tools like emerald, gold, stone, wood, etc.. and then it shows all the variables underneath. Just thought I'd share since it sounded cool.

  • @gautambatra24
    @gautambatra24 12 лет назад

    FYI howtodo, sockets are there in both languages. Differences in functionality exist of course (what would be the point of having 2 languages otherwise). But this is a beginner's tutorial, and we're not going to talk about sockets and threads here now, are we?

  • @elipark9300
    @elipark9300 7 лет назад

    0:39 thanks bucky i learned how to spell enum the RIGHT way

  • @artvandelayimports
    @artvandelayimports 11 лет назад +5

    I keep getting an error. It says people cannot be resolved to a variable. Please help

  • @dendendennison1945
    @dendendennison1945 12 лет назад

    final indicates the variable is a constant which means you can't change the value of it

  • @AbdullahAlam
    @AbdullahAlam 10 лет назад +64

    Wow. I'm 17 and don't have a gf yet. Damn, this video crushed my self esteem.

    • @datojokhadze7542
      @datojokhadze7542 9 лет назад +5

      it's not necessary to have one till 18-20

    • @jaybartgis5148
      @jaybartgis5148 9 лет назад +7

      Dato Jokhadze not even that.

    • @BobTheZealot
      @BobTheZealot 9 лет назад +2

      Jay Bartgis Please subscribe to my channel ruclips.net/channel/UChBEgkJkiCAAJGzlarNqoiQ

    • @jaybartgis5148
      @jaybartgis5148 9 лет назад +5

      Abdullah Alam maybe you could make a string array of random feminine names... and import the Random utility to assign you a girlfriend. lol

    • @Viking102938
      @Viking102938 9 лет назад +11

      Abdullah Alam
      Scanner s = new Scanner(System.in);
      int averageProgrammerYearlyWage = 50000;
      int averageSoftwareEngineerYearlyWage = 70000;
      int wage;
      while(wage > 49999){
      int girlfriends++;
      }
      while(wage > 69999){
      System.out.print("
      Enter the number of girlfriends you'd like");
      girlfriends = s.nextInt();
      System.out.print("
      You have " + girlfriends + ". Look who's laughing now.");
      }
      /* There's going to be -- plenty -- of time in life for a girlfriend and/or significant other. The majority of people waste their time on pointless relationships in Highschool/College that never branch out or go anywhere. # of people that regret marrying while in College > # of successful people who have mature, sensible relationships in their mid 20s - mid 30s. */
      And I disagree Dato, having a girlfriend isn't "necessary" in any phase of life, and it -- certainly -- doesn't need to be a "before 21" requirement. I've met a lot of people that are absolutely miserable in their current relationships because they rushed things and tried to fulfill some quota. In contrast, I've met plenty of people that are perfectly content with their single status, and are just enjoying life in their preferred capacity. I think the only people that insist you need to have a "girlfriend" are just uncomfortable with being by themselves, and need another human being validate their existence.
      Than again, I also detest the cold formality of dating and titles like "boyfriend" or "girlfriend", and I also hate the idea of taking somebody on a "date". Can't just deeply care for somebody and want to take them for a night out, it has to be a "date" (a cold social word we use because we can't express ourselves without conceding to popular social norms); I may just be biased.
      When the time comes and you find the right person, it'll happen. Doesn't mean you don't have to look or try, but you shouldn't feel bad if it hasn't happened yet, either. This idea of reckless experimentation and needless quota meeting is why most relationships now fail, and why our divorce rates are over double what they were a century ago.

  • @RameenFallschirmjager
    @RameenFallschirmjager 5 лет назад

    Awesomeness at the next level!

  • @cm_channelyt
    @cm_channelyt 12 лет назад

    I love the description of the video!

  • @GottaGood
    @GottaGood 13 лет назад

    @fatalmystic its that you learn (if u dont already know) how to use it

  • @saby8765
    @saby8765 6 лет назад

    3:35 - "Make sure this is different than this", doesn't have to be.
    You can use same variable names in local/ constructor scope, it will not affect the global declared variables, but it's advisable to use 'this' keyword. Example below.
    public class SampleClass {
    private String someVar;
    SampleClass (String someVar) {
    this.someVar = someVar;
    }
    }

  • @SergeantBalthazar
    @SergeantBalthazar 13 лет назад

    @xPredable Well, Java is good for making pretty basic games, but when I get into the bigger and bulkier stuff, I'll probably use C++.

  • @mouhamethfadalmarabyaidara4935
    @mouhamethfadalmarabyaidara4935 8 лет назад

    Great job guy,Thank to ya i'm no more fuzzy with enum in java.May God bless ya.

  • @lesterknome
    @lesterknome 15 лет назад

    Very naice bucky, looking for a tutorial on this forever

  • @Rred26
    @Rred26 11 лет назад

    I believe you can. You would have to alternate between strings and variables which gets tedious ie.
    System.out.println(people + " " + people.getDesc() + " " + people.getYear());

  • @davyjonesno1
    @davyjonesno1 11 лет назад

    You can also use crtl + c to copy.

  • @Unearthed13
    @Unearthed13 12 лет назад

    You probably have a semicolon at the end of the 'for' loop statement, lose it and it may resolve the problem ... it did for me and I had the same error code you did

  • @AdiTya-yb1fy
    @AdiTya-yb1fy 6 лет назад

    Bucky You're Amazing.

  • @mrbanana832
    @mrbanana832 7 лет назад +9

    mr bucky and his gf collection 😂😂

  • @TheaDragonSpirit
    @TheaDragonSpirit 12 лет назад

    "or desc if your lazy, which I am... so it works out!" :-) I like to be lazy but most of the time these days am not... glad you are teaching me to be lazy again. Personally I prefer to be efficient. :-)

  • @RsTheZigec
    @RsTheZigec 11 лет назад

    Yea, that's normal, I didn't too. But for expample I use it for Games. Since it represents constants, you can define your game state for example. It's very useful once you know how to use it and what to use it for : ). This may not be the most important thing to spend your time learning just yet.

  • @quequequenananana
    @quequequenananana 12 лет назад

    1) Both are objects, they are just different ways of declaring them... One in your main class, the another in this enumeration...
    2) what return does is actually return a variable of the type of the method
    public int five() {
    return 5;
    }
    Now, if you say people.five(); its the same as saying "5" (People is an object, nothing else, in case you dont get why the "people.five()", to getYear is like saying "22", "10", etc...

  • @TheViolinCalamity
    @TheViolinCalamity 13 лет назад

    @TheSamLegacy You mean it gets visual and we are no longer tied to the command line (wel the eclipse one?)

  • @fatalmystic
    @fatalmystic 15 лет назад

    thanks for the great tutorials!
    one question i have: why give it a constructor if the values will never change/ can't be set?

  • @jackpot9112000
    @jackpot9112000 10 лет назад

    I love your videos man! Keep up the great work!

  • @einhacker-typ6457
    @einhacker-typ6457 7 лет назад +2

    I'm having trouble with the"people". Is it similar to the "tuna people = new tuna();" when introducing a different class?

  • @mrnuke1
    @mrnuke1 10 лет назад +2

    why do the name of constructor parameters can not have the same names as enum fields?
    try
    private final String desc;
    tuna (String desc) {
    this.desc = desc;
    }
    this will work "and you should know why"

  • @SergeantBalthazar
    @SergeantBalthazar 13 лет назад

    @Hawkclan1 No, I'm in high school :D And I'm NOT doing this to mod MineCraft. I'm doing this to make a game that is mine and my own :)

  • @hauteswan2541
    @hauteswan2541 7 лет назад +1

    Thank you that helped a lot. It's ok. My husband is a serious coder and he got me. And I even play video games with him. It might just happen for you guys. But in the meantime, let's program so we can learn to make video games.

  • @GeekyMe97
    @GeekyMe97 13 лет назад

    @Unon1100 Yes, I understand that, obviously.
    I've been programming in other languages for 4 years, but I don't (yet) see what Enumeration could be used for.

  • @saby8765
    @saby8765 6 лет назад

    One other thing, you can and probably should override the toString() method in your enum class and have the formatting of the variables lined up there. In that case you won't need to write a big-ass Syso statement, instead you can simply pass the enum, and the overriden toString() will be automatically called by JVM and you'll get pretty results.
    Also notice the name() method used to fetch the name of the constant, since I'm overriding the toString(). If you don't override the toString(), it will always just return the name of the enum.
    @override
    public String toString() {
    return name()+" : "+desc + " : " + year;
    }
    and in your main method you will write:
    for (tuna : people.values()) {
    System.Out.println (people);
    }
    Look how clean the code looks! Again, these are not necessities but is just standard practice.

  • @ferfykins
    @ferfykins 5 лет назад

    Great video, thanks Bucky. What IDE is this though?

  • @GrudgeofmyDiary143
    @GrudgeofmyDiary143 14 лет назад

    uhm can i ask what text editor you are using in this tutorial?? it looks cool! please tell me.. ^_^..

  • @abail7010
    @abail7010 5 лет назад

    I don’t wanna get confused at all!
    Names the enum completely different from what it actually shall represent :D
    But anyways, nice tutorial bro! :)

  • @shashgo
    @shashgo 11 лет назад

    question: Previously you showed that constructors are created using the public keyword as in ;Public tuna(){} but in this one you just say you create one by saying tuna(){}
    So when does one use the public and when do you not

  • @milankbudha
    @milankbudha 4 года назад

    we can also write tuna constructor as:-
    tuna(String desc,String year){
    this.desc=desc;
    this.year=year ;
    }

  • @Fbiman93
    @Fbiman93 14 лет назад

    "She was a 'bigmistake.'" I love it.

  • @Dookiii
    @Dookiii 14 лет назад +1

    Damn, Bucky got Poon at age 10! what a player

  • @TurnForeverYouAndMe
    @TurnForeverYouAndMe 13 лет назад

    I think once I have a better handle on this I'm gonna make my own series to mirror Bucky. These tutorials are great but sometimes it just goes "swish" over my head and I wish there was a step by step explanation version that tried to explain it in a totally different way. Maybe in a couple months time I will be there to answer the calls of a legion of confused amateur coders!
    I am the batman.

  • @SuperCrazyman777
    @SuperCrazyman777 11 лет назад

    Well, don't feel bad if you're confused, I'm considered a genius and I often have to rewatch parts of these videos. Java can be overwhelming!

  • @waqqas_the_wicked
    @waqqas_the_wicked 14 лет назад

    Are you sure values() is a static method? It wouldn't need an instance to call it if it were static

  • @abovestand
    @abovestand 14 лет назад

    So enums are like auto created objetcs with constant instance variables and no methods? In other words, just a way to organaize data?

  • @skouro31
    @skouro31 7 лет назад +4

    What happened to Nicole?

  • @ChickenSkit
    @ChickenSkit 13 лет назад

    i have to start all the way from the beggining , the thing about my ADHD its that it takes 2 shots to learn something without forgetting the past tutorials :( back to nr 1

  • @deedit4666
    @deedit4666 8 лет назад

    6:10 When he says you need the classname, you actually out it there, because people is of the type tuna(like for example x is of the type int)

  • @arturogirona9847
    @arturogirona9847 11 лет назад

    Better than the videos taking too long to load.

  • @Erican1000
    @Erican1000 12 лет назад

    not sure myself but i believe it could be used more when you need to manipulate allot of data. I'm sure we'll find out!

  • @REEV4
    @REEV4 12 лет назад

    why is the enumeration constructor needed? shouldn't "private final string" already determine the two variables set in the objects? (also, why are they called objects, since they make no reference to external classes?) I have this doubt because, in the paramaters of the constructors, he puts description and bday, but doesn't set them to anything, so shouldn't they be null? and then he assigns them to "desc" and "age". any help would be apreciated!

  • @Rock4896
    @Rock4896 11 лет назад

    I'm using this for my 2d minecraft clone to store the data for each type of block, Thanks!

  • @rellsw02
    @rellsw02 12 лет назад

    enumerations are a custom data type created by the programmer

  • @shirazzamarad515
    @shirazzamarad515 8 лет назад

    +thenewboston Hey man i like your videos, i find them real helpful, I just need to know:
    Why did enum potpie require a constructer?

  • @Hawkeye0918
    @Hawkeye0918 9 лет назад +3

    I am confused, when would these be needed. Seems like you could just use normal get and set methods.

    • @deedit4666
      @deedit4666 8 лет назад +2

      +Hawkeye0918 if you mean the enumerations with these, imagine wanting to make a programm including cars and at startup you already want an object for every car of the car class. So instead of making a class you make an enum and have your variables already set

  • @brandonmcdonald7705
    @brandonmcdonald7705 6 лет назад

    "Welcome to your next Javathutorial"