By the way: classifying the getMembers() function as static does not matter when you're using an object to reference it. So member1.getMembers(); ... the fact that getMembers() is static is irrelevant. Where static METHODS come in handy is, as Bucky said, when you want to call a method (such as getMembers to view members) without having to create an object.
@ItzTheFury So do I. My programming teacher had to cancel a few classes due to illness and also got behind on marking, so we all have to watch up to and including 50. But we started from 38, so it's not too bad, I guess.
@coolshoos Yeah the mod people are gone i think. I might end up useing this for a mod for minecraft :P But i might also just go and become a game creator myself.
@RaymundoGabriel When you're formatting strings either using String.format or System.out.printf %s replaces a the actual string in the first argument like this e.g. System.out.printf("%s", name). You see here, we've put %s to be a representative of an actual name variable, and then in the second argument (seperated with a comma) we told Java what string will that be. Hope it helps. :)
@skinassz According to what I looked up, when you use "printf" to output data, %s represents String data while other letters like %d represent some other data type (in that case, it's int or number value).
if you do not make getMembers() static, then you explicitly need an instance of the class, (an object), in order to access the private static variable members. As such, assume that for some reason the program requires the data in the variable members, but tuna has yet to be instantiated,(no tuna object exists). Well, if getMembers() is static then the problem is solved and we use tuna.getMembers() as opposed to relying on some object of type tuna.
@Fuman2211 in other words, had members been public, then we could have said tuna.members and accessed the variable members directly via an explicit call using the class name. However, since members is private, the class tuna cannot access it directly and therefore needs a helper method, namely getMembers(). If getMembers() is not static then only an object of type tuna can use it. But if it is static, then it can be called explicitly by the class tuna via tuna.getMembers().
bucky you could have also referenced your main method for a example, since all java programs run main method first, its a static method which doesnt need a object so it can run.
so...static final means it will be shared among all objects created from the class. Because its final, the objects can not change this variable once it is initialised. Im guessing this would be useful for things such as ... pi? In a maths program you might declare pi and make it static final as it is not something that changes, and applies to a number of things within maths
when i change member1 to member2 i still see Megan Fox 3
1osmit 1 week ago
Hello? Housekeeping, Housekeeping...Housekeeping?
Imperceivable 3 weeks ago in playlist Java (Beginner) Programming Tutorials
By the way: classifying the getMembers() function as static does not matter when you're using an object to reference it. So member1.getMembers(); ... the fact that getMembers() is static is irrelevant. Where static METHODS come in handy is, as Bucky said, when you want to call a method (such as getMembers to view members) without having to create an object.
AlderDragon 3 weeks ago
@AlderDragon Thank you! I was wondering if getMembers() would work without being static and sure enough, it did.
bluewilliam 2 weeks ago
@AlderDragon ... or, a non-static method worked when it was memberX.getMembers() as opposed to className.getMembers()...
bluewilliam 2 weeks ago
"moron static" ????
lol!
onechannel100 3 weeks ago in playlist Java (Beginner) Programming Tutorials
Look at this Bitch watch?v=QlEiwelbNGM&feature=related
Fuckin copied the whole series OMFG
nishantve1 4 weeks ago
@nishantve1 Holy crap, your right. That's pathetic.
Darkcore71 3 weeks ago
@nishantve1 Gawd, even the names of the hotties! Well, at least he must have liked this series.
bluewilliam 2 weeks ago
=)) nice learning material ... just lay off the "let's just go ahead's"
Hacktor666 1 month ago
lets all join forces at the end of this series and make the ultimate game XD
35spike2 1 month ago
@35spike2
That would be awesome
iEditEffects 1 month ago in playlist More videos from thenewboston
static, moron!
edziomy 2 months ago
what if the third method (the static method) didn't have the static keyword?
JSA19882007 2 months ago
What is %S? @xxchidoriPOWERXx says its a String but what does it actually _do_?
AphexRepublic 2 months ago
@AphexRepublic "%s" prints the value of a string. So, in the print statement, if you put
"%s", "name" it will work, but, if you put "%s", 7, it wont work since it is an integer
hope this helps!
Mirza839 2 months ago in playlist Java Programming Tutorials
3 Tuts left(Including this)!!!
xJustas 2 months ago
@xJustas Sorry to disappoint you, but this series go up to Tutorial 87.
GeekyMe97 1 month ago in playlist Fler videoklipp från thenewboston
@xJustas Sorry to disappoint you, but this series go up to Tutorial 87...
Go check it out for yourself.
GeekyMe97 1 month ago in playlist Fler videoklipp från thenewboston
So thats why it was saying "You're making a static reference to a non-static field".
hoddie54 2 months ago in playlist Java Programming Tutorials
Must....go...on...So...much...command line....I want graphics!
mcfundash1 2 months ago in playlist Java Programming Tutorials
can you have two different classes with the same static variable/object name and refer to both variable/object in your program? just wondering.
korkypnoy 2 months ago in playlist Java Tutorial Playlist
Ivanka Trump :3
Alavistaven2012 2 months ago
He used Ctrl+V to paste!!!
lNUMPUN 2 months ago
I think a lot of people are eager to get to 50.
razer2002ro 2 months ago
Anyone doing these for the android tutorials?
TheJackACID 2 months ago 5
@TheJackACID Yessir. Saw the comment in the 1st android video, decided to learn this.
stri8ted 2 months ago
Why can't we use System,out,println((name of class).getMembers()) for Strings, I need help :(
ismailzd 3 months ago in playlist TheNewBoston - Java Programming
woo Minecrafters!
DCodeMast3r 3 months ago
1 step closer to tutorial 50: Graphical User Interface GUI :D
MrEmil20 3 months ago 14
Perilously close to the magical tutorial 50 that I'm looking forward to!
TheDiggster13 3 months ago
You have to give courses at the MIT, you're very understable, java is so easy with you!!!
AlephAriadiate 3 months ago
A point of confusion: members of the class, vs members of the club
lol
Mindstormscreator 4 months ago in playlist Java Programming Tutorials
number 50 sounds cool.must...get...there
chrisall76 4 months ago in playlist java tutorials
@chrisall76 I've been eyeballing tutorials 50/51 since day one but I promised myself I would watch all the tutorials up until then.
Vapula909 3 months ago
This has been flagged as spam show
cant wait to watch 50...
JKTCGMV13 4 months ago in playlist Java Programming Tutorials
Man you've learned more java m8s than most of mine teachers :D
metatemusaaa 4 months ago
47 and going
strelok4546 4 months ago
I will finish number 49 TODAY! I've been slacking
swashbladeRC 5 months ago in playlist Java Programming Tutorials
Didn't get it till this video thanks bucky <3 took a little messing around with to fully get it but i think i have it for the most part now
jakebobjo 5 months ago
i always had problems with static..
tx for the VDO dude
mhdmirshad 5 months ago
its late at night and my goal is to get to part 50 tonight,, like the last guy... -_-
6oog1epop101 5 months ago 2
Have - to - get - to - part - 50 - today...
ItzTheFury 5 months ago 73
@ItzTheFury *At part 50* So - close. Must - finish - series.
pkerpker1234 1 month ago
@ItzTheFury So do I. My programming teacher had to cancel a few classes due to illness and also got behind on marking, so we all have to watch up to and including 50. But we started from 38, so it's not too bad, I guess.
bluewilliam 2 weeks ago
@bluewilliam your teacher just has you watch these instead of actually teaching?
11011101111 1 week ago in playlist Bucky's Java Tutorial
@11011101111 Yes, but it was extraordinary - we were behind schedule and had to get caught up.
bluewilliam 1 week ago
@11011101111 (We're back to teaching again.)
bluewilliam 1 week ago
@bluewilliam that's cool, just surprising to me.
11011101111 1 week ago
The only java tuts where megan fox pot pie and tuna are all said in the same vid
DazKins 6 months ago
Only thing I don't understand is why the method getMembers() has to be static, even if its just returning a variable.
xFelicianoX 6 months ago
@xFelicianoX The same reason why public static void main() Is static
DazKins 6 months ago
@xFelicianoX The same reason why public static void main() Is static 6:00
DazKins 6 months ago
63 whoop
wmcl10 6 months ago
yay for frariables.
zerohourkevin 7 months ago
Thank you". Ive been trying to make a static method like a Math class, and call it without an object. Thank u so much :):):)
efronberlian 7 months ago
I think that the minecrafters stopped by now
coolshoos 8 months ago 84
@coolshoos lmao the minecrafters didn't have the persistence to make it this far xD
seed419 8 months ago in playlist Bucky's Java Tutorial 6
@seed419 I haven't stopped yet. xD
xqnp7 7 months ago
@seed419 I did! But then again I've been doing C++ for awhile now :]
KittyPlaysViolin 7 months ago
@seed419
Guess i'm not a minecrafter then....
MrQuadtje 7 months ago
@seed419 i'm a minecrafter.
AccendoCerebrum 6 months ago
@AccendoCerebrum so am I shhh :)
seed419 6 months ago
@seed419 iam a mincrafter u b****
wmcl10 6 months ago
@seed419 im a minecrafter, but didnt need those tuts for minecraft mods lol personal bsns
iXavierProductions 6 months ago
@seed419 I did. Though I'm not learning for that.
TheBenPicko 6 months ago
@coolshoos NOPE
chrisall76 4 months ago in playlist java tutorials 2
@coolshoos I actually did.
gatoo23 4 months ago
@coolshoos I'm a minecrafter but I'm doing this cos I want to learn java
TheDiggster13 3 months ago
@coolshoos Nah, I'm still here. But I'm not interested in making mods tho, I'M GONNA MAKE MY OWN GAME!
bace1000 3 months ago 2
@coolshoos Yeah the mod people are gone i think. I might end up useing this for a mod for minecraft :P But i might also just go and become a game creator myself.
shipmaster4000 3 months ago in playlist Java Programming Tutorials
@coolshoos Nope. I'm still here!
FalconFetus8 2 months ago in playlist Java Programming Tutorials 4
@FalconFetus8 hand in there bro we can do it!
RandomMalcolm 2 months ago in playlist JAVA Tutorial (The New Boston)
@coolshoos I'm still here! :3
Well, I'm learning Java since I rather learn Java than C# or C++ and so I can create rather simple games.
(But I'm going to try out Minecraft modding anyways~ ^-^)
GeekyMe97 1 month ago in playlist Fler videoklipp från thenewboston
@coolshoos Nope. I'm not only doing this for minecraft, I'm doing it for a school project :P
Unon1100 1 month ago in playlist Java Programming Tutorials
@coolshoos Not me :)
Well, I make other stuff too :D
nissehutt 1 month ago in playlist Java Programming Tutorials
@coolshoos Not worth it :D
HTMLMINECRAFTGUYJAVA 1 month ago in playlist More videos from thenewboston
@coolshoos
i am a minecrafter, but I don't plan on making mods. I'm going to make my own freakin' game. :D
iEditEffects 1 month ago in playlist More videos from thenewboston
@coolshoos Wrong!!!
mrstubzzz 1 month ago in playlist The New Boston Java Tutorials Bucky
@coolshoos Only the impatient ones.
Those with an actual interest in programming will probably go further.
InvaderWakkoReborn 4 weeks ago in playlist Java (Beginner) Programming Tutorials
"in stuff like math" I Lol'd..
sirnickey 8 months ago
WHAT DOWS THE "%" MEAN TO JAVA?
RaymundoGabriel 9 months ago
@RaymundoGabriel When you're formatting strings either using String.format or System.out.printf %s replaces a the actual string in the first argument like this e.g. System.out.printf("%s", name). You see here, we've put %s to be a representative of an actual name variable, and then in the second argument (seperated with a comma) we told Java what string will that be. Hope it helps. :)
cvrco15 8 months ago
@cvrco15 hThanks , Saludos desde Mexico , (hello from Mexico)
RaymundoGabriel 8 months ago
@RaymundoGabriel saludos ;)
cvrco15 8 months ago
does System.out.println(tuna.getMembers()); only work for static variables?
c0decub 9 months ago
@c0decub nope it works with any variables and methods ;) As long as it does return something and not a void.
threeclock 9 months ago
@threeclock i tried returning a private String first; but it didn't work unless it was static
c0decub 9 months ago
@threeclock so yes, you have to make your return a public static String getFirst()
c0decub 9 months ago
what is %S?
skinassz 10 months ago
@skinassz String
xXchidoriPOWERXx 10 months ago
@skinassz According to what I looked up, when you use "printf" to output data, %s represents String data while other letters like %d represent some other data type (in that case, it's int or number value).
zldamstr 9 months ago
MAN i finaly understood why! WHY! TY for these awesome tutorials! Can't w8 for the GUI!
Zorobay 11 months ago
I've learned more from you in 1 day than 1 month in class! Thanks Bucky!!
AMGrevolution 1 year ago 7
@Fuman2211 This is correct.
xXChaosHavokXx 1 year ago
You dont Need to make the getMembers static since it outputs a static variable it will output the same thing no matter which object you use it with.
mihek 1 year ago
if you do not make getMembers() static, then you explicitly need an instance of the class, (an object), in order to access the private static variable members. As such, assume that for some reason the program requires the data in the variable members, but tuna has yet to be instantiated,(no tuna object exists). Well, if getMembers() is static then the problem is solved and we use tuna.getMembers() as opposed to relying on some object of type tuna.
Fuman2211 1 year ago
@Fuman2211 in other words, had members been public, then we could have said tuna.members and accessed the variable members directly via an explicit call using the class name. However, since members is private, the class tuna cannot access it directly and therefore needs a helper method, namely getMembers(). If getMembers() is not static then only an object of type tuna can use it. But if it is static, then it can be called explicitly by the class tuna via tuna.getMembers().
Fuman2211 1 year ago
Thanks 4 the explanation, quite clear now
Vibeland 1 year ago
@TheHelpingangel WELL IM Guessing soemwhere in ur tuna class you used 'tuna ' as your object...............
jafarkay 1 year ago
0:45 whaatt? supenough?
mepicaelsobaco 1 year ago
@mepicaelsobaco "Simple enough" :|
Haroids 1 year ago 2
From 5:00 you keep saying object but actually what you wanted to say is instances. Those are instances of objects.
danieLs0xFF 1 year ago
@danieLs0xFF Instances and Objects mean the same thing, those are just different terms.
DawnOfDemise 11 months ago
Was I the only one thinking "getLaid"? Rofl
lollylylols 1 year ago 4
it took me minutes to understand what u teach, but at the Uni , it is longer.
Dalwanaage 1 year ago
Who's bright idea was it to make Random class's methods non static? :(
abovestand 1 year ago
bucky is the best...........
mijanashik 1 year ago
SUPERHERO STATIC SHOCK. lol when static is mention static shock comes to my mind.
Saladon89 1 year ago
Well done bucky...
MrSanoka 1 year ago
Constructor
GamingJediPwns 2 years ago
bucky you could have also referenced your main method for a example, since all java programs run main method first, its a static method which doesnt need a object so it can run.
daFranch1se69 2 years ago 2
not a good example for class varable
does any one tell me what mean
public static final int kk=4;
is it static/
i think it constant
plz reply me at
skype/googlr talk =hmk25061984
hmk25061984 2 years ago
watch the next tutorial and it should be clear.
static = applies to all objects created
final = non modifiable (constant)
so...static final means it will be shared among all objects created from the class. Because its final, the objects can not change this variable once it is initialised. Im guessing this would be useful for things such as ... pi? In a maths program you might declare pi and make it static final as it is not something that changes, and applies to a number of things within maths
xXMikeScottXx 2 years ago 4
@xXMikeScottXx
Pi is built in java.
Try Math.PI :)
Wildlylucky 1 year ago
thanks
vbrshi 2 years ago
Static variables are known as Class variables btw.
yasuodances 2 years ago
Thanks! =D
hichloecheese 2 years ago
Thanks!
Nice trick!
68kaspar 2 years ago 33
Comment removed
snasebrase 2 years ago
This has been flagged as spam show
BOING!!!!!!!!!!!!!
lynner1234 2 years ago
This has been flagged as spam show
TWELTH!
PwningNo0bsIsFun13 2 years ago
This has been flagged as spam show
11'th i guess
justill45 2 years ago
This has been flagged as spam show
9th
MilkDot 2 years ago
This has been flagged as spam show
8th!
k1ant15 2 years ago
This has been flagged as spam show
7th!
bullah7865 2 years ago
This has been flagged as spam show
6TH
NuMb3r1PuNjAbI94 2 years ago
FIFTH!
pspkid17 2 years ago
FOURTH!
thenewboston 2 years ago 76
@thenewboston Hey, thanks for the help with java, always wanted to learn it lol
FreePKMNWalkthroughs 8 months ago
THIRD!
SpyCrab 2 years ago
FIRST!
fatassgandalff30 2 years ago