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

Link to this comment:

Share to:

All Comments (707)

Sign In or Sign Up now to post a comment!
  • hi

    

  • so int is shit all about double lol?

  • going to do all of these java tutorials before i decide if i want to study computer science at third level ;

    realy helpful , thanks!

  • 2 girls for every boy, nice ;D

  • 0:26 75(types 76),or 76(types 75) xD

  • @Rami1997 Rami equals idiot? How ironic!

  • Comment removed

  • thank you kind sir!

  • I really like this channel! Ive made it my goal to learn java before summer break and this helps sooo much! Subscribed :D

  • when ever i try running 2:10 it tells me to enter the first number

    It seems to be stuck on the basic calculator

    PLEASE HELP

  • Scanner bucky = new Scanner(System.in); int girls, boys, people , remainder; girls = 13; boys = 2; people = girls / boys; remainder = girls % boys; System.out.println(people); System.out.println("Remain"); System.out.print(remainder);

    Thanks bucky for your tutorials!

  • @EpicMultiFailure Lol nice name

  • int - integer (whole number, no decimals)

    double - Anything

  • was it anyone else's first thought when he explained the Modulus that you could use it to change the base of a number?

  • Girls and boys and people counters :D

  • when i did 7/ 22 it didnt give me the whole pi D:

  • 0:25 WHAT HAVE I MISSED??

  • no i forgot about doing that

  • 5 pages of notes so far...

  • @SuperCheezyGuy I have 11 so far...:)

  • lol boys =3

  • import java.util.Scanner;

    class apples{ public static void main(String arg[]){ Scanner brucey = new Scanner(System.in); int a, b, c, answer; a = 15; b = 5; answer = a/b; System.out.println(answer); }

    }

  • 76 seventy five

    75 and seventy six

    They are integers

  • 3 boys + 6 girls > 9000 units of fun.

  • @TheViolinCalamity thanks

  • Bucky,

     What program do you use to record your monitor?

  • @TheAwesome1Online He's using camstasia i think..

  • so why dont we use doubles only?

  • @ClanNGOG because sometimes you need a whole number answer like if you were:

    dividing 11 oranges between 3 people (without cutting them), or

    working out interest on a bank balance (you cant have half a cent/penny/yuan/yen/rupee/what­ever), or

    basically any division operation which might not be a whole number but where you need one. It's very useful with the remainder (% I think) operator.

  • Broad-ended idea :P

    import java.util.Scanner;

    class apples{ public static void main(String args[]){ System.out.println("Number of Girls Divided by Boys--"); int girls, boys, people; girls = 7; boys = 3; System.out.println("With 7 girls and 3 boys, the results are:"); System.out.println("The Modulus, or remainder:"); people = girls % boys; System.out.println(people); people = girls / boys; System.out.println("The Divided Result:"); System.out.println(people); }

    }

  • Write a program to read a distance in kilometres (as a "double"). Compute and print the time in seconds that it would take to travel that distance at 85 kilometres per hour, then convert these seconds to hours, minutes and seconds and print those out. [see "Corresponding output" section below for expected output format] Method ====== Declare the speed as a constant. Read the distance as a "double" value, and convert it to seconds of travel using the formula time = distance / speed can u help?
  • I want to know Write a program to read a distance in kilometres (as a "double").

    Compute and print the time in seconds that it would take to travel that

    distance at 85 kilometres per hour, then convert these seconds to hours,

    minutes and seconds and print those out.

  • The math in the beginning is wrong; it should be people = girls * boys

    teehee

  • Mine comes out as a wrong number i put it your exact code and it doesnt work? Plss help Bucky/Greg

  • @kinkotheclown67 I'm Not bucky and I'm probably more nOObish than you with java but will try to help. Do you mean the answer is just wrong, or is it saying your code is buggy? remember to put spaces in between each */+/- etc and the numbers.

  • he says: 75(typing 76)

    saying 76(typing 75)

    xD

  • the modulus he's talking about is shift then press number 5

  • Hey I tryed to Divide by zero and it give me Infinity :D -- import java.util.Scanner;

    class test2 { public static void main(String args[]){ Scanner bucky = new Scanner(System.in); double Patate, jambons, beuf, bouffe; Patate = 1; jambons = 8; beuf = 0; bouffe = Patate * jambons / beuf; System.out.println(bouffe); }

    }

  • maybe I'm stupid, but I can't find a modules on my keyboard anywhere :/

  • @magstrike105 lol, I searched my keyboard for a few minutes and found out that the Modulus he speaks of is actually a % symbol. :D

  • @oversurprisedguy lol fail

  • for brits, a Modulus is basically the Remainder.

  • @cobezz if you dont get how it equals 3.0 you should not be programming.... or you should turn up the volume on your pc

  • @dddddddd92 i was revering to the decimal...

  • Is it not possible to cast the answer as a double so the original variables are still int's but the output is a double?

  • import java.util.Scanner;

    class apples{ public static void main(String args[]){ Scanner locky = new Scanner(System.in); int girls, boys; double people; girls = 11; boys = 3; people = girls / boys; System.out.println(people); }

    }

    it equals 3.0, explain please? :)

  • @Cobezzz He explained this, it's because it's int, not double.

  • @Cobezzz Okay guys stop being mean.. So the reason that it is 3.0 is because he has it set to int which stands for integers. Integers can not show decimals other than zero so it doesn't show remainders. Double does show remainders. So when he used int it just wiped out everything behind the decimal. When he used double it showed the decimals because it doesn't wipe them out. When he used modulus it just show the remainder. That is the whole number not the decimal like if you did division.

  • @greendaybass1 thanx

  • @Cobezzz You did watch the video, right?

  • I'm watching every single one of these so that I don't miss anything in correlation to making a game.

  • Girls plus boys equals people, lol

  • @Kingfish212 It should be baby...

  • why do i have to use int when i can use the more accurate double ?

  • @daswada9 Because if you are making something for someone to download, you might want to keep size down, and also you have that .0000000001 bug.

  • @daswada9 plus, say you are coding C.O.D, when will you ever have 5.2 bullets left or 9.45 people alive?

  • @jaredjeya you have point

  • oh thank the lord for you dillybar because i honestly did not know where or what that sign is and it looks smaller on the tutorial :) still yet another great tutorial.

  • @0813frances it's the percentage symbol

    

  • ha im in 8th grade :P

  • @kid3499 me too

  • a modulus is the % sign for those who didn't know :)

  • why the scanner is there when there's no user input needed but predefined variables add and subtract each other

  • How do I type the modulus on my keyboard? Never used it for computers before ;)

  • Modulus key mmmmmmm.... Key that looks like a person mmmmmmmmmm Nope cant find the stickman

  • Wasn't java eclipse made by java eclipse?

    Ironic isn't it?

  • Im getting better at this stuff but i cant really remember all the (); by myself :P

  • Help! I have all the code perfectly for the calculator, but every time I compile it doesn't do so automatically. It asks me to put first the second number and then it solves. Any suggestions?

  • @PsychedelicPrimate the same happend to me

    

  • I got the 1400 like :3

  • i luv his tutorials , for me its a mix of humors ... its funny ..... and its helpful .... keep up the great work dude .... looking forward for more of your tutorials ! 

  • @SzeTheProGamer i dont know why i watch this but its fun and programming is for pros and im 12!

  • @pivotalternativ dude really no one cares that your 12. doesn't mean your'e smarter just because you're 12, it just means you have a better attention span than most 12 year olds. I was the same way when I was 12(:

  • @pancakesimone i dint meen it that way srry if missunderstood because i ment its kinda stupid to watch programming vids if you have no use for em ;)

  • @pivotalternativ haha no problem man I didn't mean to be rude sorry about that:P and hope you get into coding, its a reallyyy fun hobby!

  • @pancakesimone k no prob :D

    but isnt it a hard task ? not ``HARD`` but it takes time?

  • @pivotalternativ haha agreed :D  i m a teen too

  • @SzeTheProGamer cool :)

  • Neither I'm here for minecraft ;3

  • i am soo here to learn how to make a game

  • You are the best teacher ever

  • Modulus?

    Don't know that Pokemon.

  • I keep wandering from tutorial 7 to 11 to 8 and elsewhere...I'm trying to generate random numbers 1 through 6 (like on dice) and then assign the result to a formula. for example, rolls 3, then +2; or rolls 6 then +0. I'm trying to make a game called "How many petals on the rose". any hints?

  • Error: Could not find or load main class Domain

    I am getting this on all my class files when I try to run them?

    Class files have worked before.

  • Simple way to get both number and remainder. Disregard the System.out's if they do not interest you I just like to make it look good.Not sure if there is a simpler way to do it but the results of this are nice.

  • import java.util.Scanner;

    class advCalculator { public static void main(String args[]) { Scanner calculator = new Scanner(System.in); int cats, dogs, animals; cats = 11; System.out.print("Cats = "); System.out.println(cats); dogs = 3; System.out.print("Dogs = "); System.out.println(dogs); animals = cats / dogs; System.out.print("Total animals = "); System.out.println(animals); animals = cats % dogs; System.out.print("Remainder = "); System.out.print(animals); }

    }

  • turn on closed captions and go to 5:13 :p

  • i love you bucky <3

  • mine keeps saying editor does not contain a main type!!!! please help

  • @ihavetoshutthewindow you need to do the public static void main then type { and on the bottom type }

  • I'm here for minecraft and runecraft coding xd

  • wow im an idiot scratch my last comment...

  • how do i get the modulu symbol?

  • @82zo82 its just the normal percentage sign %, press shift and 5 on pc

  • Anyone here for runescape scripting?

  • @iArn4v I'm not here for minecraft.. but will will use it on minecraft, so you're half alone.

  • @MineCrafterBrad Same here I guess. If I can apply to something, I'm going to apply it to that. And as well all know, Minecraft is easily moddable.

  • i kinda wanna make a Minecraft INSPIRED game...but not minecraft. my idea is to make a 3D version of one of notches old games called miners4k

  • @Trialtrex21 make it like a mmo that would be sweet ill help you when i finish learning java cuz im a noob :(

  • @AlchemistiK1 well i still need to learn too, so itll be some time before i get the INDEV made. but i could use your help :)

  • "Scanner cannot be resolved to a type"

  • Coolio:) Nice Videos.

  • you couldn't have made just one 9 hour vid --_--

  • @Game2Gaming the point of this is to separate out certain areas of learning and concepts so people can find corrections if needed when they run into problems, but also 9 hour videos are a pain to skip through due to the fact that you might skip over 15 minutes if you barely click the mouse.

  • OMG someone help im trying the scanner bucky = new Scanner(System.in) stuff and it always give me errors and i have everything like bucky i even write the bucky word to see if was that and no nothing!!! this is what it say Exception in thread "main" java.lang.Error: Unresolved compilation problems: scanner cannot be resolved to a type scanner cannot be resolved to a type at tutorials.tutorial7.main(tutor­ial7.java:6)

    HELP!!!! please

  • @Ptm1219 copy and paste your code in the comment, we don't know what it says, but if we do, we could most likely help you.

  • @MinerPenguin alright this is the entire code -->

    package tutorials;

    import java.until.scanner;

    class tutorial7 { public static void main(String args[]){ scanner bucky = new scanner (System.in); double fnum, snum, answer; System.out.println("Enter first num: "); fnum = bucky.nextDouble(); System.out.println("Enter second num: "); snum = bucky.nextDouble(); answer = fnum + snum; System.out.println(answer); }

    }

    in the other comment will be the error

  • @MinerPenguin Exception in thread "main" java.lang.Error: Unresolved compilation problems: scanner cannot be resolved to a type scanner cannot be resolved to a type at tutorials.tutorial7.main(tutor­ial7.java:6)

  • @Ptm1219 Change the word scanner to Scanner. The first letter is capitalized.

  • @KingVikram nop the same

  • @Ptm1219 Change import java.until.scanner; to import java.util.Scanner;

    it's not "until', it's "util".

    Also, Scanner should be capitalized all over in the program.

  • @KingVikram oh ok thanks it works

  • @Ptm1219 It means you forgot Main, I had the same problem, Ensure you write

    Public static Void main(String args [])

  • @ismailzd yeah thanks man it won't happen again hahaha

  • I started this for minecraft, but realized that programming is really fun so now I just do it for fun.

  • @hobosmurf its not wise practice to perform mathematical operations within a print statement. Either define your calculations and store the result in a variable or declare a method to do it for you.

  • Comment removed

  • what is minecraft...?

  • @TheCookie0303 is the best game ever!!!!!!!!!! apart from the GTA's lol obviously the genre is not the same, try out the demo for 90min or look for videos on youtube

  • 0:24  76 seventy five or 75 seventy six

  • @TheATactics lol, I paused the video to come down to the comments and say the same you did xD

  • modulus? I call it the percent sign ._.

  • Exception in thread "main" java.lang.ArithmeticException: / by zero at MathOperators.main(MathOperato­rs.java:10)

    Guess who divided by zero?

  • Am I the only one NOT here for Minecraft? o_o

  • @iArn4v

    No, you're not, i only want to learn it, also if i wrote sth else ;D

  • @iArn4v nope lol I'm with you on that..

  • @iArn4v probably

  • @iArn4v cant wait to make mods

  • @iArn4v No, I am here for game development and school :D

  • @iArn4v MAKE YOUR OWN F**ING GAME

  • @daymond12345 I'm here for my own game...

  • @MattMcCool Wasnt talking to you, i was talking to the NOOBS who want to rip-off minecraft :) Im glas SOME people want to make there own games and IDEAS!

  • @daymond12345 Oh, i know, and i must admit, i'd like to make mods for Minecraft, but in all fairness, you get more by making your own game, money for example, or if you're lucky enough, fame like Notch, i can't say i don't want fame, but it most certainly isn't my goal! :)

  • @iArn4v I'm not here for Minecraft...

  • @iArn4v Im not :D

  • @iArn4v i just want to make video games and im onily 11 years old!!! no joke.

  • @iArn4v no, i'm hoping to make my own game... but i might mod minecraft for practice.

  • @iArn4v Do i vote up if i am not here or down if i am not here for Minecraft, DEAMMIT YOU CONFUSED MEH!!!! -_-

  • @ashadow0309 he wasn't asking a question

  • @xXninjagingerXx No, Look at the top comments, "thumbs up if your here to mod minecraft" Do i vote down if im not? lol

  • @iArn4v I'm just here because I find this stuff interesting...I guess it could be fun to make a mod for a game, though.

  • @iArn4v AM here cuz of the economy i need money

  • @iArn4v I'm just here to learn to code :)

  • @MonkeyMoney1011

    I'm here for developing for Android

  • @MonkeyMoney1011 me 2!

  • @iArn4v i some day want to develop android apps. that's why i learn java

  • @iArn4v You aren't. I'm not here for minecraft too.

  • like if you're 15 and DO give a fuck.

  • Thanks SO MUCH I'm using this so I can make a bukkit plugin. Like this if you are also use this so you can make a minecraft bukkit plugin :D

  • where the fuck did you get that squiggly symbol at 4:06 ???

  • @MrHourlyCookie should be shift + 5 on a standard american keyboard

  • Great work setting up thenewboston. You´re better then my teachers at the university of Amsterdam... I donated some $ to you, so you can keep up the good work!

  • Thankyou! (I figured out my little issues)

  • I made a BMI calculator!

  • wat program r u using?

  • @oscarsimpson70 eclipse it's hard to use o.O

  • @oscarsimpson70 use jcreator or netbeans, eclipse you have to compile it manually by going to the command prompt.

  • @Claymore2408 Actually, it was Notpad++ that makes you go to the command prompt. Eclipse works fine. :)

  • first of all THANK YOU :)

    ur vdos r rly grt.

    import java.util.Scanner; and Scanner bucky = new Scanner(System.in);

    are not needed in this program i guess,

    pls chk it .

  • Comment removed

  • COOKIES!

  • Is the modulus the percent sign above the 5?

  • @bluestreak711 yes, though it is called "modulo".

  • i didn't get the Mod part. (%)

    Anyone has somewhere i can look into it? I need to understand the logic of Modulus. I'm not english so I don't understand the part he explains it as he uses a strange expression.

  • @specialnogo If you divide 23 by 9, you get 2.5555 etc. if you were to sit down and divide it using long division by hand, you'd get a remainder of 5. Modulus just skips the division and only displays the remainder of the division - if the modulus brings up a 0, the number was perfectly divided.

  • @picardfish tks m8. I kind searched it in google to my language understood what it was. But tks for the answer!

  • I have a question...

    If:

    Int1 = 10

    Int2 = 25

    and Int3 = Int1 = Int2 (This works but I suppose you already knew that),

    If that works and total now equals 25, Would you ever recommend using this?

    I think it's unnecessary to do Int3 = Int1 = Int2 instead of using Int3 = Int2.