Added: 2 years ago
From: thenewboston
Views: 74,792
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (187)

Sign In or Sign Up now to post a comment!
  • Bucky is so fucking awesome. He could probably get a badass job with his skills but instead he teaches us all of this <33

  • You are the biggest boss ever!

  • what kind of program do you use to write java?

  • @rc2000123 eclipse, follow his beginner tuts

  • @runemick nvm mind i found that i put the " to soon in the printf

  • Comment removed

  • It always goes:

    two is done sleeping.

    one is done sleeping.

    three is done sleeping.

    for me.

    Always in that order!

  • @thermalshockone the normal Random method isn't really random since it will give the same numbers every time unless you use a diffferent seed each time

  • @steebai its called Eclipse and its very good I have it I love it its actually what notch used to make minecraft if you know who I'm talking about

  • what program is he using

  • @steebai go watch the first tutorials.

  • @steebai eclipse

  • i had an error until i put private in front of the variable in the Apple class any thoughts on why?

  • Multicore apps?

  • WHO IS SLEEPING??? i don't understand a fck word of this video!!!!!! i'm gonna freak out

  • Who put: time = r.nextInt(999999); like me?

  • @SurgeDungeon :))

  • Is it important to use less Threads? How many Threads uses big programms?

  • have you been whatching the terminator movies, T1 T2 T3 lol

  • Mine says

    one is sleeping for 300

    two is sleeping for 597

    three is sleeping for 36

    three is doneone is donetwo is done <--- Have i done something wrong?

    

  • @371Foreman you haven't, it's just that all threads have a random number(time) assigned to sleep.

  • @371Foreman You probably just forgot to add \n to the "%s is done\n"

  • @371Foreman In your second class (with the run method) change "System.out.printf("%s is done", name);" to "System.out.printf("%s is done\n", name);"

  • @WindowsErrorFixer Wow, this comment scared me! I mean, we're at the second series of Java (all in one about 90 episodes) and he needs helt to put a \n there?

  • @371Foreman you forgot to ad the /n at 3:18

  • @hackstuff123 i put it in, but that was the output.

  • @371Foreman sorry i meant \n ... did you also put name after it

  • Comment removed

  • Comment removed

  • @UltraSpaceWalrus you don't know java and is watching java GAME development tutorials

  • Bucky you extremly good in this java thing, i really want to know if you can do a quick and urgent video on Client server side of java. My internet was down but im back on and im writing on this client server part of java on the coming monday 2011-10-31.

    I would recommend you writing a book cause you present java in such a simple way.

    Thank you in advance

  • why does my last line prints out like "three is donetwo is doneone is done" not every text in next line like his?

  • hey bucky i have all the code from tut 1 and 2 but when i click run it does nothing any help?

  • I used to use scratch, and I understand how the sleep command in these can be VERY usefull

  • anyone know what IDE he is using?

  • @TheSharkasmCrew Eclipse. I would recommend downloading the Java EE version from the downloads page.

  • @falco659 thanks a lot man. also, lol out of all the people to reply a star fox fan does that's funny

  • @TheSharkasmCrew Eclipse IDE for Java Developers

  • Threads does not speed up your program, but the GUI of your application.

  • @FrostyGame threads don't really speed up anything per say, but allow multiple execution at once

  • @flump999 if it wasnt just a simple mistake a really think you should go watch over his previous tutorials again, thats a bit to simple

  • @xXZarlachXx What are you doing here? O.o

  • this is "pretty much" an awesome series :P

  • @flump999 did you use an ampersand instead of the percent symbol?

  • take a look at this java 2d game: /watch?v=7_sYPFesfzQ

    awesomest first attempt @ creating a 2d java game!!!!

  • @Cavemanbennett

    I love how it's under your channel.

    Also, nobody can find out if that's really a good java game because you didn't use a screen recorder...

  • Comment removed

  • @flump999 that's probably because you've put & instead of % :L

  • I watched 80 begginer java tutorials from thenewboston do i no enuf to keep on goin with game devolopment?

  • @dtgonzalez1 I think you should work on your spelling first.

    But if you've finished the beginner, intermediate, and game programming tutorials(and understand everything), you have a good amount of knowledge to keep going.

  • I love how the first one has like +120000 view and this one has +48,000views.

    I image minecrafters faces went like this;

    =D :D :) :] :| :[ :( >:C

  • @Bollatic not true im still going

  • there are still errors in my apple.java

  • @xXMinecraftboyXx You did something wrong.

  • @xXMinecraftboyXx haha. Make sure you use run() instead of Run().

  • @xXMinecraftboyXx Also, make sure you use try & catch correctly.

  • When i run it nothing comes up in the console

  • For guys who does not know Threads yet:

    Bucky's videos are generally awesome but 2 videos on the threads are people who already knew it but wants to refresh their memories. The thread topic is a bit more deep and you have to study on it to have a grasp. Without that I wouldn't recomend you to push to game development

  • 3 threads doesnt make your programm 3 times faster :-/

  • one is sleeping for: 652

    two is sleeping for: 484

    three is sleeping for: 308

    four is sleeping for: 463

    My sleeping thread is always starting one two three four

    Why ?

  • @bkbenemy Because when a computer generates random numbers, There not truely random There often very long algerithms that run based on current time (Very precise time), each compiler can compile its own alogorthim, Your one sucks XD

  • @bkbenemy oh sorry i didn't read what u said correctly, ignore my last one, because your computer will tell the threads to start in order, but they run similtaniously, So they will end at differn't times, but will most often start in order depending on your processor

  • You should have saved three lines of code by calling start when instantiating your thread objects.

  • what was that application you runned ?

  • @nafaka12 I'm going to guess it's Eclipse, I'm using the same program...

  • bucky please upload j2ee tutorials..

  • Are you Notch?

  • @ilovehpwands are you Obama?

  • @RaverGames pretty much

  • @ilovehpwands cool ^^

  • i fix the code java.util.random.*; should be java.util. otherwise you get an error. apparently my eclipse works differently than bucky's

  • dont listen to these its fake!!!!!

  • All I get when I run it in chrome is "public class Danny { public static void main (String[] args) { Thread t1 = new Thread(new Apple ("one")); Thread t2 = new Thread(new Apple ("two")); Thread t3 = new Thread(new Apple ("three")); t1.start(); t2.start(); t3.start(); }

    }

    "

    ignore the "'s.

  • one thing if you don't understand java like me start with something basic like "Pascal" its easy to learn then "lite-C" Then "java" and ur done but I learned "Python" (programing language directed to games) java is directed to objects it creates multiple classes has you saw in the video if you were paying attention and you require a bit of skills and brain to understand what will happen when you compile the source code so have a nice day and good luck programing your own games :P

  • @TxDevenxT The file name isnt Apple then. It's saying that the class name doesn't match the file name... double check?

  • @hotdog24449 Did you ever fix it i have this problem too

  • Three-thousand seven-hundred seventyth!

  • I like this vdo very much... Thank you very much for your support and it useful for me

  • lol just started java like 3 days ago and feel like a pro.. thanks bucky!

  • thanks bucky

    

  • it is cooler to make the random 9999 instead of 999, u will see the messages pop up at different time.

  • why was this uploaded to the intermediate tutorials too..?

  • 1. turn cc on

    2. click transcribe sounds BETA

    3. go to 6:33

    4. LOL

    

  • @RobloxmannenTV but there isnt a 6:33

  • @RobloxmannenTV do the same thing on 4:10

    and then LOL

  • They actually don't run at the same time! I learned it in my Computer Architecture Classes, but we can say that They simulate to run at the same time! :D

  • @guerrero006 hey says it 3:55

  • @theoneandonlyhut :O sorry! hehehe XD

  • @guerrero006 they do on a multiple cpu/core machine. 1 thread per cpu/core

  • i did this in java extend script.

    didnt work at all, first line is already an error.

    what program do you use?

    and pls dont say Jcreator

  • @k4rb0n3 eclipse

  • Very interesting...

  • Great tutorial. You should go over synchronized and a few other Multithreading Shared data and critical data.

    - Great tuts

  • what's the (Exception E){}

  • i love how well you explain things.

  • what do i need to make a java game... where can i download a installer pls reply thx =)

  • @warsmith666 go to his first tutorial on java programing.

    not java game development.

  • First.

  • BUCKY TEACH US NIO :@! :D

  • Ive used Gamemaker (dont know if anyone knows what it is) untill now.

    It works in big the same as this but has much more limitations.

    I even tried to make a really good 3d physics engien but got stopped by gamemakers limitations.

    .

    Ive now for some moths tried to use java but couldnt make anything close to what i could make in gamemaker.

    After these tutorials everything became clear and i can continue to make games.

    .

    Thanks =D

  • Comment removed

  • @Alexanderstuve yer man this class uses the apple one

  • Great tutorial, thanks!

    Hehe, I remember making a chat program way back... Too bad I didn't know how to use threads back then, so if a client wanted to connect, the server would have to manually press the 'c' key to wait for a client to connect, since if the server was set to wait for a client, it wouldn't proceed until that was done, obviously... And then, also, the clients and the server had to 'refresh' the messages they got every so often manually=P

  • Is that like a skin or something on your notepad++? I have the newest one and mine looks the oldest lol :/

  • @eFiii9 He is using Eclipse.

  • But wait what order do these execute in the main method? 1, 2, 3. So they also start at slightly different times. You just can sleep them and run them parallel right?

    t1.start();

    t2.start();

    t3.start();

  • @cwieand

    The time between each start() is so small that you can say they start at the same time. The "main thread" does not get locked by the run() method or execute any code there as this is the job of the new separate thread. So it goes immediately to the next start().

  • this is absolutely great

  • Bucky, you are incredible. Keep it up!

  • Bucky are you a raid leader? haha

  • Bucky = God [no more no less ;) ]

  • commenting and rating. bucky ftw

  • Well done mate!

  • thank you very much, greatly helpful

  • three is done

    two is done

    one is done

    FTW!

  • great job! :)

  • run:

    two is sleeping for 28052

    four is sleeping for 60135

    three is sleeping for 29314

    one is sleeping for 31192

    two is done

    three is done

    one is done

    four is done

    BUILD SUCCESSFUL (total time: 1 minute 0 seconds) :)

  • time = r.nextInt(999);

    it's in line 10 in your Apple class.

  • i know :P

  • @xXZarlachXx If youre new to java what are you doin here?....

    You should probably learn java before starting to develop games.

  • @xXZarlachXx Im in sort of same position as you...although u use this 'threads' thing because...wen u make monsters that walk about, u need to move them all at the same time...if u understand me?....so u have a timer for all ur monsters to move left nd right

  • @HiGhDaRrEn You're correct. If you don't use a thread then everything is done one at a time.

  • Comment removed

  • @xXZarlachXx wow go watch the 80 or so tutorials

  • @xXZarlachXx He's showing people HOW, dumbass.

  • OMFG! thanks, man. this is awesome!

  • when i click run project it didn't say the same thing you have :(

  • hey guys amazing tut! but can some one help me make a server use threads and create a new thread automaticly every time?

  • really thanxx alot i will watch all ur totoriails when i become free

  • Why can't the threads be declared outside of a function in the Main class? I got an error saying it can't be referenced from a static context.

  • You're probably trying to access a non-static variable from a static method. (public static void main()). So make the variable static or move out of the main method.

  • @letsprogram Thanks I've never used static methods before, but now I understand it.

  • Comment removed

  • no problem :)

  • This is the best tutorial that I ever read on Java threads.

  • What did you click to run it? I used Notepad++

  • @cytt You have to use a program called Eclipse

  • Where do I download it for Windows? Could you give me the link please? Thnx.

  • @cytt google eclipse downloads then

    Eclipse IDE for Java Developers (92 MB)

  • Notepad++ can't run a Java project,

    you need a compiler to do it, and Notepad++

    is a text editor... i use for scripting,

    but you can only write programs with it

    not run them.

  • @cytt in eclipse you go to file then new project then put Apple or anything for project name then go to the little square icon below file then click class and call it Apple and the same for the Bucky class

    and in java everything is case sensitive

  • the problem is with this code atm :

    Thread t1 = new Thread(new Apple("one"));

    Thread t2 = new Thread(new Apple("two"));

    Thread t3 = new Thread(new Apple("three"));

  • problem message :

    The constructor Thread(Apple) is undefined

    The constructor Apple(String) is undefined

    The constructor Thread(Apple) is undefined

    The constructor Apple(String) is undefined

    The constructor Thread(Apple) is undefined

    The constructor Apple(String) is undefined

    i have x6 of them problems please help so i can continue with these tutorials asap .

  • I think you didnt put word new before Apple like this:Thread t1=new Thread(new Apple("one"));

  • i have the following problem message:

    Exception in thread "main" java.lang.Error: Unresolved compilation problems:

    The constructor Thread(Apple) is undefined

    The constructor Apple(String) is undefined

    The constructor Thread(Apple) is undefined

    The constructor Apple(String) is undefined

    The constructor Thread(Apple) is undefined

    The constructor Apple(String) is undefined

    at Bucky.main(Bucky.java:5)

    thats at trying to execute with problems the problem message said....(next comment)

  • public class Bucky { public static void main(String args[]) { Thread t1=new Thread(new Apple("one")); Thread t2=new Thread(new Apple("two")); Thread t3=new Thread(new Apple("three")); t1.start(); t2.start(); t3.start(); } } above is one class you have to copy exactly copy the capital letters java is case sensitive
  • I have run out of character count

  • When I run mine, the numbers are the same... not sure why.

  • I have been waiting for your tutorials from a couple of months on this topic....thanks 5/5

  • god this is amazing :D :D :D

  • I'll also add that the video won't start for me either...hm

  • hey this video isnt working

  • What is the problem? I'll try and help, I was getting a prob too but got it fixed ;)

  • hey

    it just doesnt load

    this vdeo isnt working i referesh but nothing happens a skipp it nothing happens

    the video will just not work they other ones do but not this one for some reason

  • oh, i thought you meant something with the code :P

    I'm not sure then, sorry

  • aww

  • Nice, refreshes my java knowledge a bit. ;)

    Keep up the good work.

  • Nice. Can't wait for the others

  • 面白い!

  • eddaaa

  • troll

  • I fucking hate how people say "First!" Just shut the fuck up unless your posting a comment that inst useless.

  • Rage much? I never do that, but I thought I would for once.

    Why does it matter to you?

    That comment you posted is useless too, btw...

  • Rage? Thats not rage. Thats simply stating a point.

  • Fuck you and stop saying first, dickshit. PERIOD

  • first

  • @TACOS11211 LAST !!

    Joking, I hate them too.