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.
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!
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.
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
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"
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).
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.
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.
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?
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
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.
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.
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;
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.
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.
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
@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.
@@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)
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.
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.
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.
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?
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.
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; } }
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());
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
"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. :-)
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.
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...
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"
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.
@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.
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.
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
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.
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
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!
+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
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.
The last time I took a shower was
8 months ago
LMFAOO
@@aqib1602 It's 9 months now...LOL
@@bonniesitessolutions7728 11 months... lol
@@vathsan3906 2 years now
hard one, Bucky ignores the fact that 90% of his subscribes don't have girlfriends.
therefore we succeed! :(
Look at my G+ profile and count my girl followers.
+Bob The Zealot G+ followers don't count. :P
NullChips oh lol
+Amr Nasser hmmmm 99% i guess
So Oracle is behind this... Java making woman into objects.
Lol
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
LOL
why do you always use gfs as variables, I don't have such thing
Awesome video description, Greg
I'm sure Greg doesn't like us using his real name. :D
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!
picture of kelsey or it didnt happen
AGREE
Bruh she is 10...
@@thomasnguyen2438 bruh she hasnt aged?
@@thomasnguyen2438 Amazing
(the fact that she hasnt aged..lol)
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.
Oh how badly I wish Julia sees this LOL.. Thanks for the humour man. It really helps while going through 100s of coding lessons :)
Parameter names don't really need to be difference from local field names, as long as you know the "this" keyword
this
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
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"
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!
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).
Lolled at the bigmistake part, I love the humor u put into these vids. It makes it even more fun to watch
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.
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!!
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.
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.
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?
he actually did explain it it is used for creating constants or values that u can have in handy
The video has no point because the concept of enumeration cannot really be applied towards those three individuals.
Wow! I've learned more from your tutorials in 1 day, then I have from my class in 1 week
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
Funny how the first part of this tutorial series has over 3M views, and not even 10% made it to this video.
What did you expect?
DriftEDM Counter question, why do you reply. It adds nothing.
The Jackpot Nice avoidance. I've just seen this comment so many times, so I thought to ask an opinion.
The Jackpot Counter counter question: why do you reply?
Kale Kip You think you're funny after 2 weeks? *mute*
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.
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.
Your videos are great, Bucky.
It's amazing you have so much knowledge at such a young age.
and so much girlfriends
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;
video is from 2009. maybe "this" operator wasnt implemented in java back then? just a guess, I'm new to java
+SatoruNakata Nope, he made a tutorial on the "this" keyword before this one.
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.
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.
This was just way too good! Thanks man, wherever you are
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
I'm so glad I found your channel. "Best channel ever" you may be right. Thank you so much for providing such great resources.
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!
Lovely Bucky!!!!nice to see you again!!!
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
@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.
quick shortcut for everybody instead of writing System.out.println(); all in one go
just go "sysout" then press ctrl + space
and an even shorter is "syso" + ctrl+space
@@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)
for intellij users in 2019 just type sout and tab.
@@mihaivigu2879 nice thanks
in one of the previous tutorials,you've mentioned that Nicole was your 2nd gf :P
EXACTLYYY!! IKR
Hmmmmm
he may got tow 2ns girlfriends @ one;
Ohhh the plot thickens!
man was this tutorial fun...wow...thanks * 44 for great tutorials...
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.
So happy u have a good mic. Thanks for video!
Dude, you just answered my questions again! Thanks for being so helpful(currently learning polymorphism).
Julia disliked this video 58 times
64
67
68
Eric Kwan rrrrrrrrrip
69 .. I think she's trying to say something !!
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.
Thank you sir. I really was not able understand this when I first started reading this topic. Now I know how it works.
so much fun watching you video!
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
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.
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?
0:39 thanks bucky i learned how to spell enum the RIGHT way
I keep getting an error. It says people cannot be resolved to a variable. Please help
final indicates the variable is a constant which means you can't change the value of it
Wow. I'm 17 and don't have a gf yet. Damn, this video crushed my self esteem.
it's not necessary to have one till 18-20
Dato Jokhadze not even that.
Jay Bartgis Please subscribe to my channel ruclips.net/channel/UChBEgkJkiCAAJGzlarNqoiQ
Abdullah Alam maybe you could make a string array of random feminine names... and import the Random utility to assign you a girlfriend. lol
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.
Awesomeness at the next level!
I love the description of the video!
@fatalmystic its that you learn (if u dont already know) how to use it
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;
}
}
@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++.
Great job guy,Thank to ya i'm no more fuzzy with enum in java.May God bless ya.
Very naice bucky, looking for a tutorial on this forever
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());
You can also use crtl + c to copy.
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
Bucky You're Amazing.
mr bucky and his gf collection 😂😂
"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. :-)
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.
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...
@TheSamLegacy You mean it gets visual and we are no longer tied to the command line (wel the eclipse one?)
thanks for the great tutorials!
one question i have: why give it a constructor if the values will never change/ can't be set?
I love your videos man! Keep up the great work!
I'm having trouble with the"people". Is it similar to the "tuna people = new tuna();" when introducing a different class?
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"
@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 :)
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.
@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.
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.
Great video, thanks Bucky. What IDE is this though?
uhm can i ask what text editor you are using in this tutorial?? it looks cool! please tell me.. ^_^..
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! :)
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
we can also write tuna constructor as:-
tuna(String desc,String year){
this.desc=desc;
this.year=year ;
}
"She was a 'bigmistake.'" I love it.
Damn, Bucky got Poon at age 10! what a player
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.
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!
Are you sure values() is a static method? It wouldn't need an instance to call it if it were static
So enums are like auto created objetcs with constant instance variables and no methods? In other words, just a way to organaize data?
What happened to Nicole?
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
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)
Better than the videos taking too long to load.
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!
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!
I'm using this for my 2d minecraft clone to store the data for each type of block, Thanks!
enumerations are a custom data type created by the programmer
+thenewboston Hey man i like your videos, i find them real helpful, I just need to know:
Why did enum potpie require a constructer?
so we can use it in the object in the main class
I am confused, when would these be needed. Seems like you could just use normal get and set methods.
+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
"Welcome to your next Javathutorial"