if you keep getting an endless loop you need to terminate the program that is already running on the console. the terminate button is the red square next to the X
Bucky, is there a way to end the loop only, when the user inputs a certain word or statement, kinda like a password? And is there a way to delay the timing between each loop?
i have tried something but no matter what i do i cant convert a scanner input to the counter!!!! this is what i have but i cant change it
import java.util.Scanner;
public class Whileloop { public static void main(String args[]){ Scanner INPUT = new Scanner(System.in); String SOL; SOL = INPUT.nextLine(); System.out.println(SOL); int counter = SOL; while (counter < 50); System.out.println(counter++); }
you could have put System.out.println(counter++) ^^ thank you for being the first person to make me understand code :D im so proud of my self for finding you (and you makin these vids understandable ^^)
THANK YOU!!! I've never understood loops and I have my first semester programming exam on the 6th D: Will be cramming your tutorials into my head for the next few days...
Bucky, you got some 'splainin to do...After getting a loop, I terminated, deleted the old project, started a new one exactly the same as yourn, ran it, got an Error message, but proceeded anyway, and it worked. Reset the variable to 100, ran, got an Error message again, but proceeded, and it worked. Why the Error messages? There are no X's anywhere...
TERMINATE! If anyone else has started a loop, like me....there is a RED box, like a stop icon on a video player, that will terminate the loop. It is in the menu bar in the window where the loop is running.
I'm trying a few things on my own, I've deleted all classes making the project empty, and when I try something, it says something about the apples class as an error. The apples class is something I used working through these tutorials, any help?
Oh no... I wish you told me not to put a real big number :/ Now it won't stop going up untill it reaches "2147483647". Wow, guess I'll make a sandwhich whilst waiting.
I'm not here to be another minecraft person - I'm here to learn Java to jump into making apps into Android, which is set to take over the Iphone next year. Go Android!
hi bucky (or someone,) i got a problem whit my program, its a *guess the number* program that works fine exept one thing, i let it create a random number wich is stored, then i use i while loop to be able to type in the guess, but it let me type it twice, and ideas of how to solve this? my while loop is like this
At the first place i came here to learn to make mods for mc and thats all i wanted to learn the basics but now i wanna be an advanced java programmer and hopefully make my own java game and ..work with programming :) thanks bucky cuz i think you opened another door for my future.
@PurpleSpawner85 actually these tutorial wont help much on minecraft unless your making a gui interface. you can tlook at tutorial section on minecraft forum. there you could learn minecraft java. what ı mean how the blocks and items are created.
I have discovered a serious problem with this video: an error that must be removed. There appears to be a dislike button below my video. This is a serious issue that must be handled immediately! - Sincerely-- future programmer.
@EarthWorms77 Yes it is... He sad in the beginning of the video: "The first thing that we need is a variable and I'm gonna name mine "counter"... Also in the previous vids you could learn about Variables.
@1ncr3as3 added one each time the loop went round so the first time it was set to 0 which was under 10 so it displayed that then the next time it added 1 more 0+1 is 1 and one is under 10 so it displayed that too it does this until it reaches 10 which isnt displayed because its not lower than 10
@1ncr3as3 counter++ increments the value of counter by 1 and saves it in the same variable i.e counter. So for example if counter = 1 , then after counter++ counter value will be 2.
Watch "tutorial 9 increment operators" for more clarity.
c'mon man, u didn't use ur System.out.println(counter++); like we just learned! :P
ACoolMoose 3 days ago in playlist Java Programming Tutorials
What can kind of games can you develop using java?
107makoto1 4 days ago
@107makoto1
every, from android, to flashes, to xbox using OGL,
but if you wanna create games for PC, id prefer to take care of C++
90% of low-level graphic libraries supports only c++
devilazpl 3 days ago
Comment removed
SimonThePr0 5 days ago
Comment removed
SimonThePr0 5 days ago
can anyone tell me what to use if i want a categoric variable (words)?
vloglab1 1 week ago in playlist Java Programming Tutorials
@vloglab1
you have to use String var
String text = "LOL";
if (text == "Crash") do somethin
devilazpl 3 days ago
Hahahaha as I do clicked run before adding the increment method infinite loop XD
TheHoboshowz 1 week ago in playlist More videos from thenewboston
@TheHoboshowz Me too!! I was like.. I MADE INFINITE ENERGI!! :P
TheRealDiaCraft 4 days ago
Vote up if your coming here for making Minecraft Plugins :D
TheDilluexe 1 week ago 4
lol i accidenlty ran it without telling it to stop and i couldent get it to stop lol :P
Cobezzz 2 weeks ago
@Cobezzz click terminate button
arcGunterz 2 weeks ago
if you keep getting an endless loop you need to terminate the program that is already running on the console. the terminate button is the red square next to the X
colgatetotal21 2 weeks ago
Thumbs up if you tries it with -- and didnt know how to stop the endless loop
FTD0Productions 2 weeks ago in playlist More videos from thenewboston
Hi,Thanks for posting these videos, very helpful. Thank's again and don't bother others, they just jelous.
realDoctorPain 3 weeks ago
This has been flagged as spam show
@realDoctorPain Hi,Thanks for posting these videos, very helpful. Thank's again and don't bother about others, they just jelous.
realDoctorPain 3 weeks ago
what happens if you change the position of counter++ and system.out.print(counter)?
skkk90 3 weeks ago
Comment removed
yothaman10 3 weeks ago in playlist Java Programming Tutorials
try this one
while (true)
boxyman6 3 weeks ago in playlist Java Programming Tutorials
reminds me of lua
"while true do"
fucks up everything yo
boxyman6 3 weeks ago in playlist Java Programming Tutorials
Bucky, is there a way to end the loop only, when the user inputs a certain word or statement, kinda like a password? And is there a way to delay the timing between each loop?
Thanks
YOU RULE!
thejord1000 3 weeks ago in playlist Java Programming Tutorials
i have tried something but no matter what i do i cant convert a scanner input to the counter!!!! this is what i have but i cant change it
import java.util.Scanner;
public class Whileloop { public static void main(String args[]){ Scanner INPUT = new Scanner(System.in); String SOL; SOL = INPUT.nextLine(); System.out.println(SOL); int counter = SOL; while (counter < 50); System.out.println(counter++); }
}
it gives me an error on int counter = SOL;
dragonthewatcher 3 weeks ago in playlist Java Programming Tutorials
you could have put System.out.println(counter++) ^^ thank you for being the first person to make me understand code :D im so proud of my self for finding you (and you makin these vids understandable ^^)
dragonthewatcher 3 weeks ago in playlist Java Programming Tutorials
Thumbs up if you typed counter to its max (which is 1999999999) and watched it go the whole time!
meanhumor 3 weeks ago in playlist Java Programming Tutorials
1: Copy what bucky did.
2: Replace 0 with 1001
3: Replace 10 with 1000
4: Run the program
5: Wait
mariosunshinefaan 4 weeks ago
@mariosunshinefaan it takes like half a sec >.<
dragonthewatcher 3 weeks ago in playlist Java Programming Tutorials
@dragonthewatcher Then you did something wrong. Or I told you to do something wrong...cuz it SHOULD just keep on going up forever.
mariosunshinefaan 3 weeks ago
THANK YOU!!! I've never understood loops and I have my first semester programming exam on the 6th D: Will be cramming your tutorials into my head for the next few days...
EndlessGrey92 1 month ago
hmm... Should we comment on the codes as we go through this tutorial...!?
Any thoughts, guys !?
hoan999999 1 month ago in playlist Java Programming Tutorials
amazing
thanks bucky , you are the BEST
pharmacy20101 1 month ago
Exception in thread "main" java.lang.NoClassDefFoundError
what is it?
ZraxTheBigStuff 1 month ago
@ZraxTheBigStuff its just saying that there is a problem in the main body
mugenfan123 1 month ago
now i can make a calculator!
fortawesomm 1 month ago
To save some space you could also just do System.out.println(counter++); and it will increment it after it prints it out, great tutorials though!
FroogleGeek 1 month ago in playlist Java Programming Tutorials
@FroogleGeek oh hahahah i just realized you said the same thing xD
dragonthewatcher 3 weeks ago in playlist Java Programming Tutorials
true = false
ottosweden123 1 month ago
false = true
ottosweden123 1 month ago
it is wonderful
cesareten 1 month ago
When I type the syntax while eclips buts a red X next too it stating that it should not be there why?
MrStropwen 1 month ago
thank you very much ^ ^
chaiyaram 1 month ago
Bucky, you got some 'splainin to do...After getting a loop, I terminated, deleted the old project, started a new one exactly the same as yourn, ran it, got an Error message, but proceeded anyway, and it worked. Reset the variable to 100, ran, got an Error message again, but proceeded, and it worked. Why the Error messages? There are no X's anywhere...
PhilmPhun 1 month ago
Bucky! You need to warn us first!
PhilmPhun 1 month ago
TERMINATE! If anyone else has started a loop, like me....there is a RED box, like a stop icon on a video player, that will terminate the loop. It is in the menu bar in the window where the loop is running.
PhilmPhun 1 month ago
oops...got a loop of zeroes that won't quit, even after deleting the project. what now?
PhilmPhun 1 month ago
I fucked up on this and crashed my computer.
Ivyyyn 1 month ago in playlist Java Programming Tutorials
I'm trying a few things on my own, I've deleted all classes making the project empty, and when I try something, it says something about the apples class as an error. The apples class is something I used working through these tutorials, any help?
14u82 1 month ago
Nevermind I found the terminate button :)
VideoGamerHD 1 month ago in playlist Java Programming Tutorials
Oh no... I wish you told me not to put a real big number :/ Now it won't stop going up untill it reaches "2147483647". Wow, guess I'll make a sandwhich whilst waiting.
VideoGamerHD 1 month ago in playlist Java Programming Tutorials
class apples {
public static void main(String args[]){ int counter; counter =1; while (counter < 999999999) { System.out.println(counter); counter ++; }
}
}
channel102030405 1 month ago
what just happened?
channel102030405 1 month ago
it saves heaps of time with this code
class apples {
public static void main(String args[]){ int counter; counter =1; while (counter < 999999999) { System.out.println(counter); counter ++; }
}
}
channel102030405 1 month ago
dude....i love you :)
aggrtt 1 month ago
Comment removed
RedofYellow 1 month ago in playlist Java Programming Tutorials
This has been flagged as spam show
while loop = SPAM SPAM SPAM ect.
kidharris55 1 month ago in playlist Java Programming Tutorials
So, a spam bot? xD
iGetPoints 1 month ago in playlist More videos from thenewboston
@iGetPoints can this be used in lets say.. idk a message spammer trololololol
luckarlie 1 month ago in playlist Java Programming Tutorials
now we know how to make a script to crash something...
Julzso23 1 month ago in playlist Java Programming Tutorials
@Julzso23 lol
MrStropwen 1 month ago
i like it:)
alyssa1992ful 2 months ago
12 people have issues
fancyman3553 2 months ago in playlist More videos from thenewboston
int bucky = 0;
While (Bucky <= Chucknorris){
bucky++;}
Console: 1
Wow bucky thats pritty good.
shipmaster4000 2 months ago in playlist Java Programming Tutorials
@shipmaster4000 haha :)
hahahakebab 1 month ago in playlist Java Programming Tutorials
@shipmaster4000 Hey, you watch this too, friend? Same! Im making a 3D game!
daymond12345 1 month ago in playlist Java Programming Tutorials
12 people are very dumb
epicminecraftreviews 2 months ago
I went to type in:
while(counter < 10)
and accidentally typed
while(counter < 9999999999999999999999999999999999999999)
:D
tehB3NJ1E 2 months ago in playlist More videos from thenewboston
Put counter--;
let the few seconds of entertainment ensue
iPixeIated 2 months ago in playlist More videos from thenewboston
bool bucky = true;
bool beast = true;
while(bucky == beast)
{ System.out.println("BUCKY IS A BEAST!!");
}
beastNation365 2 months ago 36
Instead of writing
System.out.println(counter;)
counter ++; you can write
System.out.println(counter++);
MrEmil20 2 months ago
@MrEmil20 or he can just write counter = counter + 1. But he reduced that step into counter++. He is being understanding toward beginners.
kulinat 2 months ago
Thumbs up if you're here to learn how to make your own game(s)!
MattMcCool 2 months ago
I thought I'd have a bash before you showed us what you were going to do, I made this.
import java.util.Scanner;
class apples{ public static void main(String args[]) { int counter; counter = 0; while (counter >= 0){ if (counter >= 10){ break; } System.out.println(counter + "."); counter++; } }
}
Basically the same as yours, but I used a IF statement to stop it. C:
Nerdpuff 2 months ago
@Nerdpuff why did you import a scanner? just curious
MrStropwen 1 month ago
@MrStropwen Had it imported from another tutorial. Didn't need it in there. :p
Nerdpuff 1 month ago
@Nerdpuff okay :D
MrStropwen 1 month ago
thumbs up if you press ctrl + s everytime you change something xD
bata97 2 months ago 29
So.. afterwards I just typed in "counter--;" instead of ++.. and the program's at -4000000 right now and counting. going down. XD
utubehackerz 2 months ago in playlist Java Programming Tutorials
Im 11 and im learning, i already know alot of actionscript 2.0 and now a little of this
daymond12345 2 months ago in playlist Java Programming Tutorials
how many years did u go to college for this lol
Game2Gaming 2 months ago in playlist Java Programming Tutorials
@Game2Gaming I doubt he learned how to program in college. I learned my first programming language at 14.
Vapula909 2 months ago
@Vapula909 Yup. I'm 14, and I totally love programming :D And more and more of teenagers begin to participate in computer projects. :P
kaimarohero 2 months ago
Terminate button FTW!
GamerCivil 2 months ago in playlist Java Programming Tutorials
My eclipse is spamming 0 and I didn't wait until he said now we need something to end it.
GamerCivil 2 months ago in playlist Java Programming Tutorials
I'm not here to be another minecraft person - I'm here to learn Java to jump into making apps into Android, which is set to take over the Iphone next year. Go Android!
ForfrontTechnology 2 months ago 2
please stops saying curly braces those are braces
bigjust12345 3 months ago in playlist Java Programming Tutorials
@bigjust12345 who cares what he says? stfu and watch it
AZNmanJJ 2 months ago
@AZNmanJJ it is not him it is just so annoying when everyone does it and it is a quicker to say brace
bigjust12345 2 months ago
This is what spam bots are made of...
example:
just ask what to spam whit the user input,then just loop it XD
vukodlak2000 3 months ago in playlist Java Programming Tutorials
I somehow knew you were gonna do < 10
codycero1 3 months ago in playlist Java Programming Tutorials
good man
Tiger360X 3 months ago in playlist Java Programming Tutorials
if this is your first time you should do somthing like BYOB.It will help you getting the concept in dont jump in to somthing like programming.
hairybratwurst 3 months ago
MC MOD: peaceful mode with monsters, go to the programming of normal and hard and put a while loop to
while(hearts > 0){
!!add to the hearts variable here!!
}
itsjustthecause 3 months ago in playlist Java Programming Tutorials
iml learning this so i can make plugins for minecraft bukkit server :D
10293847565846800 3 months ago
did you made the java script?
wuppie367 3 months ago in playlist Java Programming Tutorials
I accedently started the program without the "counter++" and I paniced cuz I thaught it wold run forever!
AbsoluteFlyer 3 months ago in playlist Java Programming Tutorials
This has been flagged as spam show
Hi
Why did start in tutorial 14 using String[ ] args instead of String args[ ]. Is it a typing mistake? thanks
misshana94 3 months ago
Hi
Wgy did start in tutorial 14 using String[ ] args instead of String args[ ]. Is it a typing mistake? thanks
misshana94 3 months ago
@misshana94 You can put them in front of String or infront of args it doesnt matter.
SprayedToTheBone 3 months ago
thanx man
anshulmodernwarefare 3 months ago
You know what's also pretty cool? you can make a program where it spams what u say . however many times u want it to. good vid man :)
zekage2 3 months ago
hi bucky (or someone,) i got a problem whit my program, its a *guess the number* program that works fine exept one thing, i let it create a random number wich is stored, then i use i while loop to be able to type in the guess, but it let me type it twice, and ideas of how to solve this? my while loop is like this
while(input.next() != null){
and my guess (wich i call tuna ) is like this
tuna = input.nextByte();
the problem is that both let me input text
if some help, email me for full class
simme337 3 months ago
good[iminent=FHLkhAgUWfOB]
jessiewang122 3 months ago
Im gonna go get ice tea, then do the next tut.
TheModernKillcam 3 months ago
what software are you used?
MrRexen92 3 months ago
Bucky is probably Notch in disguise!
tommyboii090 3 months ago 72
@tommyboii090 Wow. He must have one epic voice changer...
tehB3NJ1E 2 months ago in playlist More videos from thenewboston
@tommyboii090 He is too good to be notch, perhaps he is Jeb.
12me91 2 months ago
@12me91 Lol
TheRandomMan20111 2 months ago
Comment removed
90cdowns 4 months ago
haha fu** computer lag as hell :D
Pro3Gamer 4 months ago
thumbs up if you set it to count to 2000000000 by 1's =)
TheOtherServer 4 months ago in playlist Java Programming Tutorials 2
Hey nice video! I happen to like programming. My team and I are making a website coming soon. Please visit my channel to see more about it!
Really though, nice video.
jakeryollean 4 months ago
HELP! I MADE IT LOOPS WITH 0!
Msz9Music 4 months ago in playlist Java Programming Tutorials
Haha i used 1000000
Jarod1453 4 months ago in playlist Java Programming Tutorials
thanks!
dutchwowerke 4 months ago
you're amazing
TheDigitalQuill 4 months ago in playlist Java Programming Tutorials
I used the number 500000000
topcat5665 4 months ago
What is different of public class apple and class apple?
chosenfantasy 4 months ago
books on java for pussy...
chosenfantasy 4 months ago
At the first place i came here to learn to make mods for mc and thats all i wanted to learn the basics but now i wanna be an advanced java programmer and hopefully make my own java game and ..work with programming :) thanks bucky cuz i think you opened another door for my future.
ObsidianStronghold 4 months ago in playlist Java Learning
guys make it <1000000000
and dont ask meh what will happen :D
999narmo 4 months ago in playlist Java Programming Tutorials
Thumbs up this comment if your going to stop giving people who ask for thumbs up.
Or are you going to thumbs this up? ^.^
CreeperGB 4 months ago
@CreeperGB no im too lazy to do it
999narmo 4 months ago in playlist Java Programming Tutorials
@999narmo Good ;o
CreeperGB 4 months ago
@CreeperGB i guess :S
999narmo 4 months ago
@999narmo XD you see that i got to many negative votes! awesome
CreeperGB 4 months ago
@CreeperGB maybe they was too lazy to move the mouse to click the thumbs up
999narmo 4 months ago
@999narmo nonono as u see getting thumbs down is what i wanted ^.^
CreeperGB 4 months ago 6
@CreeperGB i guess everyone is happy :D
999narmo 4 months ago
thumbs up if you are here to make minecraft mods!
theXminecrafter 4 months ago 3
Now I can't end the program >.>
xxnactise 4 months ago
Thumbs up if wanting to make a custom client for Minecraft led you here :D
xxnactise 4 months ago in playlist More videos from thenewboston
i love this
TheUltimateM3 4 months ago
I'm really getting good at this, i didn't have a single error in the code this time.
chrisxd146 5 months ago
i like when i can thumbs up before video has a chance to load and know i wont need to thumbs down...lol good job man
lpguitarist06 5 months ago in playlist Java Tutorial (thenewboston AKA Bucky)
the interesting things about these videos are reading the comments
DazKins 5 months ago
try putting while (counter > -10)
for a never ending loop
UncontrollableTechno 5 months ago
TRYING THIS TO 10000000000000000000!
HackersAreUs200 5 months ago
watch it with transcribe audio on, i lol'd
raxil13 5 months ago
at the end change the ++ to -- and watch it go to 1000 in like 1 second lol
F4TALFURY 5 months ago
This is like C++ but less efficient. I'm only watchin this because I want to get your "Java game programming tutorials"
ziodice 5 months ago
I was here for it up until the 3rd vid now I just wanna code
poptartman123451 5 months ago
i am lolz
Jdditmore 5 months ago
anyone here for minecraft?
stupidmonkey199 5 months ago 3
@stupidmonkey199 i would like to learn java because minecraft was programmed in java.... i love minecraft
PurpleSpawner85 5 months ago 81
@PurpleSpawner85 I want to make mods for it :D
xero907 4 months ago
@PurpleSpawner85 actually these tutorial wont help much on minecraft unless your making a gui interface. you can tlook at tutorial section on minecraft forum. there you could learn minecraft java. what ı mean how the blocks and items are created.
ashleybeshir 4 months ago
@ashleybeshir Actually this helps you understand minecrafts coding ALOT. minecraft java is just java with different variables.
CreeperGB 4 months ago
Comment removed
licemeat 4 months ago
@PurpleSpawner85 HAHA! minecrafts java is pretty much all codes....good luck with that
Shockcaptain117 4 months ago
@PurpleSpawner85 tzz minecraft ^^ i learn it because i do java in the school
Pro3Gamer 4 months ago
@PurpleSpawner85 me too dude!
MrNoobtuber11 3 months ago
@PurpleSpawner85 Exactly why I'm here :)
MrWilldotcom 3 months ago in playlist java programming from 'the new boston'
@stupidmonkey199 ;P maybe
frugooscapecodemask 5 months ago
System.out.println(counter++);
WordWizzard4 5 months ago
Lol, the term for conditions that go between parenthesis in a method are called "Arguments". Just in case it slipped your mind.
Blackbrood401 5 months ago
i cheated with typing sentences. they said no copy and paste so i didnt
AustinToMinecraft 6 months ago
If someone ran the code without the counter++, click the run box to the right of the console.
HeteroProductions 6 months ago
Warning: Don't type in 5000000000000000.... >_>
MoustacheMyMoustache 6 months ago in playlist JAVA Tutorial (The New Boston) 2
@onon6 That's part of my goal with this too :P
MrSparklePandaPerson 6 months ago
looPINGAS usual I see
HappyHawaiinSauce 6 months ago
Dear youtube,
I have discovered a serious problem with this video: an error that must be removed. There appears to be a dislike button below my video. This is a serious issue that must be handled immediately! - Sincerely-- future programmer.
Gam3r979 6 months ago
is counter just a variable? Could he put "tuna" instead of counter?
EarthWorms77 6 months ago
@EarthWorms77 yeah he could've used tuna instead, it just makes more sense to call it counter ;)
Gam3r979 6 months ago
@EarthWorms77 Yes it is... He sad in the beginning of the video: "The first thing that we need is a variable and I'm gonna name mine "counter"... Also in the previous vids you could learn about Variables.
Whisperer512 6 months ago
@Whisperer512 thank you
EarthWorms77 6 months ago
@EarthWorms77 Yes.
wc4life2010 5 months ago
Could someone tell me what counter++ did ??
1ncr3as3 7 months ago
@1ncr3as3 added one each time the loop went round so the first time it was set to 0 which was under 10 so it displayed that then the next time it added 1 more 0+1 is 1 and one is under 10 so it displayed that too it does this until it reaches 10 which isnt displayed because its not lower than 10
Fanzomo16 7 months ago
@1ncr3as3 counter++ increments the value of counter by 1 and saves it in the same variable i.e counter. So for example if counter = 1 , then after counter++ counter value will be 2.
Watch "tutorial 9 increment operators" for more clarity.
ashishm1984in 7 months ago
@1ncr3as3 ++ means add one to the variable, he explained this in a previous tutorial.
massqueraider 6 months ago
@1ncr3as3 Wow I thought I had a bad memory...
CrystalPriizon 6 months ago
im already havin trouble rememberinn all these
clementng23 7 months ago
Can't wait for my first mc mod :p
onon6 7 months ago
A lot of this stuff so far looks like simple stuff from AutoHotKey.
But written in a more complex way.
So far I'm learning this stuff pretty well. :)
InvaderWakkoReborn 7 months ago 2
thumbs up if you to thenewboston to continue the java game programming tutorials
aabhu620 7 months ago
The extra line "counter++;" is not needed. Use :
"System.out.println(counter++);"
Save time
BboyFry 7 months ago 3
:)))
suuuuse 7 months ago
you explaination is very well and easy to undrstand
riyaash9 7 months ago
i change the ++ to -- and now i get a matrix code!!! it looks cool!
siaband 7 months ago
who goes to tutorial 13 and then dislikes?
YXYWantedOrphan 8 months ago