The error "Exception in thread "main" java.util.InputMismatchException" is caused in my case by the input method for decimal separator. I changed it on my control panel and problem fixed. Before I would need to write 1,0 insted of 1.0 so when I wrote 1.0 I would get this error...
i get an error when i put in a deciaml number like 34.6;
Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Unknown Source) at java.util.Scanner.next(Unknown Source) at java.util.Scanner.nextDouble(Unknown Source) at Calculator.main(Calculator.java:8)
I really need help on this one. My cursor selector in the editor is always on a word never inbetween them so if I make a mistake or need to add text it deletes the letters that were there to start with. This is getting really annoting please someone help me!
hey new boston,in this video you scan the number the user gives and store it in bucky,then you assign bucky to the other variables.What if you directly applied the number typed by the user,to the fnum and snum variables? Is this possible?or everytime the user inputs something the scanner variable automatically stores the new price and deletes the old one?
I did it, and it's pretty easy ofc. But still a little funny challenge before you move on. I think it's good to make something yourself and not just write everything he does. I also changed the design of my calculator by making some in the same line, changing textcolor and size.
@kakaofuglen1 dude can you youst help me little bit. What if i don't know what's the code ? Is there any way to search like in Javascript officall website you youst write what you want and then it shows you the results what you need to write ...
@TheLieutenantE That you can see in his previous tutorials. Unfortunately i'm also new to this, so i can't tell you what codes i used since i don't remember, but if you really wanna learn to, either search "how to" on google or look in his previous tutorials (:
@kakaofuglen1 I made it plus if you write text, it says wrong input type, number excepted and if you divide by zero it says you can't divide by zero; and it restarts the program :)
can any one help me I am getting this error when I type a float number (1.1 1.2 etc.):
Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Unknown Source) at java.util.Scanner.next(Unknown Source) at java.util.Scanner.nextDouble(Unknown Source) at tot_02.main(tot_02.java:13)
trying to understand this shit is hard. fnum = bucky and bucky also mean system.in. That system.in means what ever i type in on the key bored. but bucky.nextDouble also means system.in with numbers? wtf X(
Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Unknown Source) at java.util.Scanner.next(Unknown Source) at java.util.Scanner.nextDouble(Unknown Source) at apples.main(apples.java:8)
That line in my program states:
fnum = bucky.nextDouble();
Is that just what a Double variable can and cannot read? I'm using Eclipse Helios...
helow! im realy thankful & appreciate for your video it helps me a lot as a 1st year BSIT student, but can i ask you something? as what you did in your video i think you just use only an operator addition adding two numbers,how about subtracting, dividing & multiplicating ..do you have a tutorial about it?..
Can anyone tell me how i can make it so you can choose + or -? i tried making a new variable, and making it so that the variable is the user input, but when it doesnt seem to work to well to just say "answer = fnum plusminus snum", which i can understand, but then how do i do it?
I have done anything you did (word for word) and I get an error as soon as I enter first num that sais: 'Exception in thread "main" java.util.InputMismatchException
@xetrius I think you have a non-english windows and the character what separates numbers from decimals is not "." but "," (like for me, I'm from Hungary) So enter the first num as "34,6"( NOT as "34.6")
I learned alot so far but im just wondering, if you do the "if"and get a value that gose to "else" can i have the code inside the methods run another class?
I just started learning Java... and I came up with things in this script I removed ln in printing first system out and the second and I added at the end ------ System.out.print("Your answer is: "); System.out.print(answer); System.out.println(" ."); ------ instead of --- System.out.println(answer);--- so it will print like: "Enter your first num: (here)" "Enter your sencond num: (here)" " Your answer is: (the answer here)." that's fun.
Got a glitch here, I think: I did all as you said, but want to write a formula that adds 15% to a value. Example: fnum = 1.65, and snum is 15%. It won't calulate correctly. Any hints?
@PhilmPhun Okay well you could do so you don't type in as a percentage.. but instead use a decimal system.. so yeah *0.01 but leave out when you input the % as % isn't a number xD wouldn't really work methinks?
How would make a users input string equal to a number? Like say the user types in "Cat" cat would be a int or a double but when i try that it says "Cannot be resolved to a variable". Anyone out there that can help me?
@joeslayer97 Yea, Im trying to have it stored so i can use in later to calcuate a problem later on in the program. Ex: i want "cat" = 5. So when the user types in "cat" it knows that it has a value of 5. You get what im saying?
@TheThreeDarkAngels You cant do it that way.. there is a way but the only thing i can remember is "char". its a variable that holds a character not a string.
@TheThreeDarkAngels Are you insinuating that you're trying to save the string "cat" as an integer? That can't be done because integer means whole number (3.6 is NOT an integer, 4 and -2 are integers) and double, in this sense, means any number at all (-3, 3.6, 4, 0, etc.). Are you asking how to save a regular string as hexadecimal string for encryption? That is WAY beyond the level of this tutorial, encryption and obfuscation are some of the most advanced programming techniques out there.
@TheThreeDarkAngels I think double is only decimals but idk... and Cat has to equal something to be used with int? I'm still very new to Java so idk lol
@TheThreeDarkAngels I have a book on Java. It's about 1400 pages lol but I find thenewboston's tuts easier than reading this book. The book I got is Ivor Horton's Beginning Java : Java 7 Edition. I've read almost 200 pages and done almost no coding at all lol.. I picked up this book today too xD
@TheThreeDarkAngels ARe you trying to convert letters to their numerical values? Double and Int can only store numerical values, but you can (Don't remember how) convert from letters to numbers.
If you mean changing a string to a # (as long as the string is a number :P) use ----- (integername) = Integer.parseInt(string name);
or for a double ----- (doublename) = Double.parseDouble(string name);
i have a problem. i cant seem to get the result. When i press the run button i don't get anything and all my code is right. CAN SOMEBODY HELP PLZ!!!!!!!!!!!!!!!!!!!!!!!!!!!
i need your help on my assigment. our instructor gave us a program wherein we will explain it line by line. please explain to me what's the use of this in my program..
char type = in.nextLine().toUpperCase().toCharArray()[0];
below is complete syntax. please help me. thanks in advance!
import java.util.Scanner;
class weight1 {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
System.out.println("Enter pounds or ounce as your original unit of distance (P/O): ");
i need your help on my assigment. our instructor gave us a program wherein we will explain it line by line. please explain to me what's the use of this in my program..
char type = in.nextLine().toUpperCase().toCharArray()[0];
below is complete syntax. please help me. thanks in advance!
import java.util.Scanner;
class weight1 {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
System.out.println("Enter pounds or ounce as your original unit of distance (P/O): ");
I'm actually very fluent with flash and actionscript already. So I could probably skip a bunch of these. BUT! It's always best to look at everything so you don't miss anything.
Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Unknown Source) at java.util.Scanner.next(Unknown Source) at java.util.Scanner.nextDouble(Unknown Source) at Start.main(Start.java:8)
@theflumpster - You've probably typed the word 'Scanner' with the letter S in lower case! The words 'System & Scanner' in java should always be typed with the first letter S in upper case.
I am trying to make a quick program for minecraft that shows the id when you type in the block or item. But it doesnt work :S
import java.util.Scanner;
public class Class1 { public static void main (String args[]){ Scanner input = new Scanner (System.in); double stone; System.out.println ("Enter block/item:"); stone = input.nextDouble (); stone = 1; System.out.println (stone); }}
I am a noob at java an this would be my first program. :)
That program should only print out the numder 1. If you remove the stone = 1; You would get the number you type in when you enter block/item. What is it you want the program to print out?
Whenever I press "Run" in Eclipse, it doesn't do anything...HELP!!!
KingArthur13th 2 hours ago in playlist Java Programming Tutorials
Apples ! :D
Exteelspirats 7 hours ago
I made a pretty awesome text-based calculator from what bucky taught me: pastebin (dot) com/dUJxpei8
VinylRa1n 6 days ago in playlist Java Programming Tutorials
formulars?... do you have any tuts?
PrincesElf 1 week ago
TheHoboshowz 1 week ago
I got an error saying " double cannot be dereferenced" when trying to run
fnum.lucky.nextDouble(); ^
cometsrush 1 week ago in playlist More videos from thenewboston
This has been flagged as spam show
@cometsrush I think it should be fnum=lucky.nextDouble();
zaidalyafey 5 days ago
The error "Exception in thread "main" java.util.InputMismatchException" is caused in my case by the input method for decimal separator. I changed it on my control panel and problem fixed. Before I would need to write 1,0 insted of 1.0 so when I wrote 1.0 I would get this error...
PalmaIsrael 1 week ago
@PalmaIsrael I have the same problem...Any solution?
88arcanum 3 days ago
when do you tell the program to go to next number when you press enter?
asgerkill 1 week ago
never mind, figured it out. it works with a , not with a .
W0ut3er 1 week ago
i get an error when i put in a deciaml number like 34.6;
Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Unknown Source) at java.util.Scanner.next(Unknown Source) at java.util.Scanner.nextDouble(Unknown Source) at Calculator.main(Calculator.java:8)
anyone know why?
W0ut3er 1 week ago
I cannot enter a number with decimal point, such as 9.97..Help me!
tienthanh21697 1 week ago
I really need help on this one. My cursor selector in the editor is always on a word never inbetween them so if I make a mistake or need to add text it deletes the letters that were there to start with. This is getting really annoting please someone help me!
winfest2010 1 week ago in playlist Java Programming Tutorials
My claculator only does numbers without numbers behind the ,. i wrote it exactly like this but i still get an errormessage. what do i do?
myinternetsuckscom 2 weeks ago
if you want to show less decimals use this code after the first answer code :
answer = Math.floor(answer * 100 + .5) / 100;
Math is a class, in the lang package, that callz method floor that you use to round off the decimal points .
sesshoumaru3st 2 weeks ago in playlist Java Programming Tutorials
hey new boston,in this video you scan the number the user gives and store it in bucky,then you assign bucky to the other variables.What if you directly applied the number typed by the user,to the fnum and snum variables? Is this possible?or everytime the user inputs something the scanner variable automatically stores the new price and deletes the old one?
DevilOnHog 3 weeks ago
@4:41 you see it's 2:22 am, well he stays up late for us :) well thank you bucky
55Briony 3 weeks ago
@55Briony i don't think the time is right because the date is the day after this was uploaded
cabutr 2 weeks ago
thumbs up if pyropuncher brought u here
stevezes 3 weeks ago
Pyropuncher <3
iXaminez 3 weeks ago 27
@iXaminez he teaches us to learn NOW LEARN
rvbfan121 3 weeks ago
A little challenge:
Try to make a calculator that can + - * and /
I did it, and it's pretty easy ofc. But still a little funny challenge before you move on. I think it's good to make something yourself and not just write everything he does. I also changed the design of my calculator by making some in the same line, changing textcolor and size.
Thumb up so ppl can get challenged!
kakaofuglen1 3 weeks ago 53
@kakaofuglen1 Ty!
jeffery1855 3 weeks ago in playlist More videos from thenewboston
@kakaofuglen1 hey can you tell me what can i do with java ? . Some examples of works. (I want to be app. developer ;) ).
Thanks see ya
GamesForLifes999 2 weeks ago
@kakaofuglen1 dude can you youst help me little bit. What if i don't know what's the code ? Is there any way to search like in Javascript officall website you youst write what you want and then it shows you the results what you need to write ...
Thanks
GamesForLifes999 2 weeks ago
@kakaofuglen1 hey i did your challenge all, but one part. How do you change the text color and size?
TheLieutenantE 2 weeks ago in playlist Java Programming Tutorials
@TheLieutenantE That you can see in his previous tutorials. Unfortunately i'm also new to this, so i can't tell you what codes i used since i don't remember, but if you really wanna learn to, either search "how to" on google or look in his previous tutorials (:
kakaofuglen1 2 weeks ago
@kakaofuglen1 k thanks
TheLieutenantE 2 weeks ago
@kakaofuglen1 I got it on my first try, nice challenge :D
RaptoJP 2 weeks ago in playlist Java Programming Tutorials
@RaptoJP How the hell did you change text color and text size? You probably already learned some java before.
uratoko 2 weeks ago
@uratoko I didn't learn any Java before, I just experimented with the coding and got that.
RaptoJP 2 weeks ago
@RaptoJP One does not simply get to know how to change text size and color by himself.
uratoko 1 week ago
@kakaofuglen1 I can't seem to be able to add multiple actions :( Also are u sure He had font size ect. in an earlier video?
HeavenlyBlade106 1 week ago
@HeavenlyBlade106 I figured it out; pastie(dot)org/3193023
HALOzMODDER 1 week ago
@HALOzMODDER With help from a friend ^_^
HALOzMODDER 1 week ago
@kakaofuglen1 Yes having trouble on multiple actions.
HALOzMODDER 1 week ago
@kakaofuglen1 Yay I've done it! but I havn't got custom size and color :/
HeavenlyBlade106 1 week ago
@kakaofuglen1
Haha accepted the challange :p got it finished too. But I couldn't find a way to modify text size + color? Maybe he'll explain more later on
TheHoboshowz 1 week ago
@kakaofuglen1 I made it plus if you write text, it says wrong input type, number excepted and if you divide by zero it says you can't divide by zero; and it restarts the program :)
gatoo23 1 week ago
Enter first Number:
324
Enter second Number:
5235432432
The answer is 5.235432756E9 you numnum!!!
dragonthewatcher 3 weeks ago in playlist Java Programming Tutorials
import java.util.Scanner;
public class Calculator { public static void main(String args[]){ Scanner Calc = new Scanner(System.in); double firstinput, Secinput, answer; System.out.println("Enter first Number: "); firstinput = Calc.nextDouble(); System.out.println("Enter second Number: "); Secinput = Calc.nextDouble(); answer = firstinput + Secinput; System.out.print("The answer is "); System.out.print(answer); System.out.print(" you numnum!!!"); }
}
dragonthewatcher 3 weeks ago in playlist Java Programming Tutorials
can any one help me I am getting this error when I type a float number (1.1 1.2 etc.):
Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Unknown Source) at java.util.Scanner.next(Unknown Source) at java.util.Scanner.nextDouble(Unknown Source) at tot_02.main(tot_02.java:13)
TheJonkaa 3 weeks ago
@TheJonkaa nvm I foud the problem
TheJonkaa 3 weeks ago
And I thought calculators were cleaver...
ThexKezza 1 month ago in playlist Java Programming Tutorials
Remember, its , not .
ledtc 1 month ago
does anyone know how to cancel those little widnows, like in 2:57? They're SERIOUSLY annoying =P
ultislasher1 1 month ago in playlist Java Programming Tutorials
@ultislasher1 Click out of the window, into the text editor part.
Theminecraftplayerdd 1 month ago in playlist More videos from thenewboston
@Theminecraftplayerdd do you know how to change it so that it never comes up again..? lol
ultislasher1 1 month ago
@ultislasher1 There might be a way.
Theminecraftplayerdd 1 month ago
@Theminecraftplayerdd yeah...
ultislasher1 1 month ago
@Theminecraftplayerdd P.S. Merry Christmas/Hanukkah/Kwanzaa!!
ultislasher1 1 month ago
I am le math experte :L
Klmblitz4 1 month ago in playlist Java Programming Tutorials
This has been flagged as spam show
trying to understand this shit is hard. fnum = bucky and bucky also mean system.in. That system.in means what ever i type in on the key bored. but bucky.nextDouble also means system.in with numbers? wtf X(
johnTRAN93 1 month ago in playlist Java Programming Tutorials
Comment removed
johnTRAN93 1 month ago in playlist Java Programming Tutorials
I've got the same problem as WiredDrummer,
This is what it says:
Enter your first number:
3.14
Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Unknown Source) at java.util.Scanner.next(Unknown Source) at java.util.Scanner.nextDouble(Unknown Source) at apples.main(apples.java:8)
That line in my program states:
fnum = bucky.nextDouble();
Is that just what a Double variable can and cannot read? I'm using Eclipse Helios...
suzanneturnt136 1 month ago
Is there anyway to change , to . ? If I use 3.14, it gives me an error, but if I use 3,14 theres no problem. Thanks for the tutorials, btw!
WiredDrummer 1 month ago in playlist Java Programming Tutorials
i think i like C++ better
nadenessnick 1 month ago in playlist More videos from thenewboston
killculator
SupremeKingSovereign 1 month ago
Anyone here actually made any games or mods after watching from these tutorials? Wanna know if they work or not D:
OMDGAMING 1 month ago in playlist TheNewBoston - Java Programming
helow! im realy thankful & appreciate for your video it helps me a lot as a 1st year BSIT student, but can i ask you something? as what you did in your video i think you just use only an operator addition adding two numbers,how about subtracting, dividing & multiplicating ..do you have a tutorial about it?..
marcobo1000 1 month ago
Can anyone tell me how i can make it so you can choose + or -? i tried making a new variable, and making it so that the variable is the user input, but when it doesnt seem to work to well to just say "answer = fnum plusminus snum", which i can understand, but then how do i do it?
SathApoc 1 month ago in playlist Java Programming Tutorials
@SathApoc u have to use if. for example:
if plus/minus = +: answer = fnum + snum
if plus/minus = -: answer = fnum - snum
im not an expert, but other python does this
agcummings11 1 month ago
@agcummings11 Ah! Thanks :)
SathApoc 1 month ago
I have done anything you did (word for word) and I get an error as soon as I enter first num that sais: 'Exception in thread "main" java.util.InputMismatchException
at java.util.Scanner.throwFor(Unknown Source)
at java.util.Scanner.next(Unknown Source)
at java.util.Scanner.nextDouble(Unknown Source)
at apples.main.(apples.java:8)'
Please, help me!
xetrius 1 month ago 3
@xetrius I've got the same problem, I just used "," instead of "." and it worked..:-P Give it a try..! Example: 34,2 instead of 34.2
XmadBear27 1 month ago
@XmadBear27 Oke, thanks =D
xetrius 1 month ago
@xetrius I had the same problem, you simply used the wrong separation point.
Try using a "," instead of a "." when you write the input number:).
So when you answer to "Enter your first number: " Write a number that doesn't have a dot in it:D
zorken123 4 weeks ago in playlist Java Programming Tutorials
@xetrius try clicking Window>Open Perspective>Java
darthaq 3 weeks ago
@xetrius I think you have a non-english windows and the character what separates numbers from decimals is not "." but "," (like for me, I'm from Hungary) So enter the first num as "34,6"( NOT as "34.6")
karolyipeti 3 weeks ago in playlist Java Programming Tutorials
@karolyipeti thank you but @zorken123 already gave that answer
xetrius 3 weeks ago
This has been flagged as spam show
@karolyipeti thank you but @zorken123 already gave that answer
xetrius 3 weeks ago
hey I am working in assginment what is the meth for char? exm: A = sc.nextChar(); ??! plz let me know
showtekno88 1 month ago
I learned alot so far but im just wondering, if you do the "if"and get a value that gose to "else" can i have the code inside the methods run another class?
Eiglew 1 month ago
21 people dont know basic math
austinewunclerful 1 month ago
Comment removed
KimuraSetsuna 1 month ago
A7GAMER 1 month ago
Ah, solved it:
answer = fnum + (fnum* (snum * 0.01));
so...computer asks "what's your number?" you type: 1.65, and it calculates 1.65 + 15% and gives you 1.89something...
PhilmPhun 1 month ago
I got it... answer = fnum +(fnum *(snum*0.01));
this is for something like 1.65 + 15 %
PhilmPhun 1 month ago
the answer i get is 1.799999999
PhilmPhun 1 month ago
Got a glitch here, I think: I did all as you said, but want to write a formula that adds 15% to a value. Example: fnum = 1.65, and snum is 15%. It won't calulate correctly. Any hints?
answer = fnum + (snum * 0.01);// having trouble writing 1.65 + snum%
PhilmPhun 1 month ago
@PhilmPhun Okay well you could do so you don't type in as a percentage.. but instead use a decimal system.. so yeah *0.01 but leave out when you input the % as % isn't a number xD wouldn't really work methinks?
joeslayer97 1 month ago
How would make a users input string equal to a number? Like say the user types in "Cat" cat would be a int or a double but when i try that it says "Cannot be resolved to a variable". Anyone out there that can help me?
TheThreeDarkAngels 1 month ago 10
@TheThreeDarkAngels wait so what do you want it to do... type in cat and it comes up with 5? i need more info of what you want to do
joeslayer97 1 month ago in playlist Java Programming Tutorials
@joeslayer97 Yea, Im trying to have it stored so i can use in later to calcuate a problem later on in the program. Ex: i want "cat" = 5. So when the user types in "cat" it knows that it has a value of 5. You get what im saying?
TheThreeDarkAngels 1 month ago
@TheThreeDarkAngels Try using an if statement such as this program:
public class testcat{
public static void main(String args[]) {
Scanner input = new Scanner(System.in);
char tessst;
if(tessst == "cat")
tessst = 5;
}
}
Maybe it'll work..
MrAetoc 1 month ago in playlist Java Programming Tutorials
@MrAetoc urmm you can't make test = cat... how about if the input is equal to cat then set firstnumber = 675432 or something?
joeslayer97 1 month ago
@TheThreeDarkAngels You cant do it that way.. there is a way but the only thing i can remember is "char". its a variable that holds a character not a string.
ZeixieZ 1 month ago
@TheThreeDarkAngels
import java.util.Scanner;
public class StartingClass { private static double fnum = 0,snum = 0; public static void main(String[] args) { Scanner input = new Scanner(System.in); String bob = input.nextLine(); if(bob.equals("cat")){ fnum = 5; System.out.println("worked"); }else{ fnum = 3; } snum = input.nextDouble(); System.out.println(fnum+snum); }
} try this :D i tested it out my self and works fine
joeslayer97 1 month ago
@joeslayer97 Thanks joe, i will give it a try.
TheThreeDarkAngels 1 month ago
@TheThreeDarkAngels make a double named Cat, then make it equal whatever you want it to
eatcheese5486 1 month ago in playlist Java Programming Tutorials
@TheThreeDarkAngels This can be done with exceptions by using a try/catch clause.
wei2912 1 month ago
@TheThreeDarkAngels
Would this work?
Cat = 5.2
If that's what you meant...
ottosweden123 1 month ago
@TheThreeDarkAngels Just make variables for each of the words i guess
mclmatty 1 month ago in playlist Java Programming Tutorials
@TheThreeDarkAngels i think i`t should be "variable = "thescannervariable".nextString();"
sorry for the bad english xD
WelberG3 1 month ago
@WelberG3 I can't see that working. Maybe you mean " Var1 = Var2.Method/Function(Parameters); "
B1KMusic 1 month ago
@TheThreeDarkAngels Are you insinuating that you're trying to save the string "cat" as an integer? That can't be done because integer means whole number (3.6 is NOT an integer, 4 and -2 are integers) and double, in this sense, means any number at all (-3, 3.6, 4, 0, etc.). Are you asking how to save a regular string as hexadecimal string for encryption? That is WAY beyond the level of this tutorial, encryption and obfuscation are some of the most advanced programming techniques out there.
B1KMusic 1 month ago
@TheThreeDarkAngels you cant make an integer or double out of string
manomama7 1 month ago in playlist Java Programming Tutorials
Comment removed
thecomputerkid11925 1 month ago in playlist Java Programming Tutorials
@TheThreeDarkAngels Uh, Maybe Variables Only Mean Integers (Numbers).
thecomputerkid11925 1 month ago in playlist Java Programming Tutorials
@TheThreeDarkAngels I think double is only decimals but idk... and Cat has to equal something to be used with int? I'm still very new to Java so idk lol
prokid585 1 month ago in playlist Java Programming Tutorials
@prokid585 Yea me to, Decided to pickup a book and read lol
TheThreeDarkAngels 1 month ago
@TheThreeDarkAngels I have a book on Java. It's about 1400 pages lol but I find thenewboston's tuts easier than reading this book. The book I got is Ivor Horton's Beginning Java : Java 7 Edition. I've read almost 200 pages and done almost no coding at all lol.. I picked up this book today too xD
prokid585 1 month ago
@TheThreeDarkAngels did you declare your variable at the top of your class?(int x; or int x = 5.28;)
TheNotch3000 1 month ago
@TheThreeDarkAngels ARe you trying to convert letters to their numerical values? Double and Int can only store numerical values, but you can (Don't remember how) convert from letters to numbers.
If you mean changing a string to a # (as long as the string is a number :P) use ----- (integername) = Integer.parseInt(string name);
or for a double ----- (doublename) = Double.parseDouble(string name);
504Dug 3 weeks ago in playlist Java Programming Tutorials
@504Dug
robisdabest1eva 3 weeks ago in playlist More videos from thenewboston
@504Dug Thanks for the ideas
TheThreeDarkAngels 3 weeks ago
Comment removed
Griffrez 3 weeks ago in playlist Java Programming Tutorials
@TheThreeDarkAngels There other types of variables (I think so) that can withstand string variables. Int and Double are both numeral variables.
Griffrez 3 weeks ago in playlist Java Programming Tutorials
@TheThreeDarkAngels i did it :D
theInspectorNZ 3 weeks ago in playlist Java Programming Tutorials
@BlahSer mine appears when I run the java code
oOShutts97 1 month ago
I don't have the console on the bottom of my eclipse program. Anyone know what I'm doing wrong? Thank you!
BlahSerr 1 month ago
I'm gettin it....My daughter provided the numbers. She says you sound like Lightning McQueen (Cars). :)
PhilmPhun 1 month ago
where do you get the scanner class from
?
@thenewboston
??????????????
HACKINGISFAKE 1 month ago
i have a problem. i cant seem to get the result. When i press the run button i don't get anything and all my code is right. CAN SOMEBODY HELP PLZ!!!!!!!!!!!!!!!!!!!!!!!!!!!
Decepticons211 1 month ago
I made a simple one where you can chose between +,-,* and /...
and here's the source if you want it :D
/zGQzSBW4 Add pastebin(.)com before :3
epicKiipa 2 months ago in playlist Java Programming Tutorials
is here something like scanf as it is in c++?
dsestuller 2 months ago
I feel so smart, I knew what to write before he said it :D:D:D:D:D:D:D
epicKiipa 2 months ago in playlist More videos from thenewboston
@epicKiipa How old are you?
zeusprp 1 month ago in playlist Java Programming Tutorials
@zeusprp 15, why?
epicKiipa 1 month ago
@epicKiipa Your channel says 55; & I thought that it's a little late to start leaning programming. :P
zeusprp 1 month ago
The best moment in my life!!!
krisinox 2 months ago
this is addicting !!!
juliolokodavida 2 months ago
wow thanks so much!!!!!
this is great i am actually getting hooked on this :D
i keep on making the calculator!!!
giotheutuber 2 months ago
This has been flagged as spam show
i need your help on my assigment. our instructor gave us a program wherein we will explain it line by line. please explain to me what's the use of this in my program..
char type = in.nextLine().toUpperCase().toCharArray()[0];
below is complete syntax. please help me. thanks in advance!
import java.util.Scanner;
class weight1 {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
System.out.println("Enter pounds or ounce as your original unit of distance (P/O): ");
ivyearatan1 2 months ago
This has been flagged as spam show
char type = in.nextLine().toUpperCase().toCharArray()[0]; System.out.println("Enter your weight: "); double weight = in.nextDouble(); switch(type){ case 'P': System.out.println(weight + " pounds is " + (weight * 0.453592) + " in kilograms and " + ( weight * 453.59232)+ " in grams. "); break; case 'O': System.out.println(weight + " ounce is " + (weight * 0.02835) + " in kilograms and " + ( weight * 28.34952) + " in grams. "); break; } } }
ivyearatan1 2 months ago
THNx for this lttle help.. :)
mljhcr 2 months ago
Dude, thanks a lot!!!! You just helped me do my homework. I have make a program that will calculate the area and circumference of an ellipse
hdjksa52 2 months ago in playlist Java Programming Tutorials
Non primitive "Scanner"......
zjuet40 2 months ago
which is better, BufferedReader or Scanner?
Xotigu 2 months ago
i need your help on my assigment. our instructor gave us a program wherein we will explain it line by line. please explain to me what's the use of this in my program..
char type = in.nextLine().toUpperCase().toCharArray()[0];
below is complete syntax. please help me. thanks in advance!
import java.util.Scanner;
class weight1 {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
System.out.println("Enter pounds or ounce as your original unit of distance (P/O): ");
ivyearatan1 2 months ago
ivyearatan1 2 months ago
god i am so hard right now
thenoobsterman 2 months ago
wow thanks im 10 and do java,javascript,and some ruby.
this is the most advanced program i made and acually know what it means
im hooked on java!
The1717awesome 2 months ago
well mine cant plus numbers with like you know .6
or .2
lucas124l24 2 months ago in playlist Java Programming Tutorials
@lucas124l24 you have to type .oo
limbokaj81 2 months ago in playlist Java Programming Tutorials
Umm dude, you made this video on May 3, 2009 at 2:22am(5:17) and you uploaded it on May 2. You can not only program great, you can time travel too!?
1Abdilatif1 2 months ago in playlist Java Programming Tutorials
would this video help me make a social network site?
sim10on10 2 months ago
Great tutorial! again.
JLuso4444 2 months ago
I created something exactly like this by accident after the previous tutorial as a little mess about xD
TheSauceGaming 2 months ago in playlist Java Programming Tutorials
Import java.util.Scanner
class poo{ public static void main(String args[]){ Scanner Ben = new scanner(System.in); }
}
That's all I can remember
bvant6 2 months ago
@bvant6 after that you put:
System.out.println(Ben.NextLine())
MrAetoc 2 months ago in playlist Java Programming Tutorials
OMG "Scanner cannot be resolved to a type"
IIOGCII 2 months ago
System.out.println("Answer: " + answer);
TimmzProductions 2 months ago
Didn't give me more than 2 decimals, and I followed it all exactly the same, lol. ;O
thatechroom 2 months ago in playlist Java Programming Tutorials
i came her to learn how 2 mc mod and now i cant STOP
Game2Gaming 2 months ago in playlist Java Programming Tutorials 30
@Game2Gaming give it a few years! you will not be able to do that until at least some experience!
singoutloud2utube 2 months ago
This has been flagged as spam show
does anyone know why this doesnt work?
final double g = 16.0
double t = 35.5
System.out.println(1 / 2 * (g * t * t));
System.out.println("meters per second squared");
any help would be appreciated
hobosmurf 3 months ago
You have to write 34,6 not 34.6 You have to use a comma
MAKLOPLO 3 months ago in playlist Java Programming Tutorials
i did the same as you did but when i try to input a numbr like 34.6 it gives an error if i input 34 it doesnt. help?
shaguarJNR 3 months ago in playlist Java Programming Tutorials
@shaguarJNR try to type in 34,6 not 34.6
tomux7 2 months ago
Crap didn't mean for that second post, can it be removed? And on top of that, can this one be removed?
codycero1 3 months ago in playlist Java Programming Tutorials
System.out.println("Enter first number: "); fnum = input.nextDouble();
codycero1 3 months ago in playlist Java Programming Tutorials
I'm actually very fluent with flash and actionscript already. So I could probably skip a bunch of these. BUT! It's always best to look at everything so you don't miss anything.
codycero1 3 months ago in playlist Java Programming Tutorials
Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Unknown Source) at java.util.Scanner.next(Unknown Source) at java.util.Scanner.nextDouble(Unknown Source) at Start.main(Start.java:8)
HELP!
aVerb94 3 months ago
@aVerb94 Use , instead of typing .
sebastianbaklundahl 2 months ago
I made mine to do this
User input: Hi!
Java Program: Hi! *says under breath* God dammnit -_-
XD
G0dlyGam3rs 3 months ago in playlist Java Programming Tutorials
he said killculator XD
itsjustthecause 3 months ago in playlist Java Programming Tutorials
Comment removed
theflumpster 3 months ago
@theflumpster - You've probably typed the word 'Scanner' with the letter S in lower case! The words 'System & Scanner' in java should always be typed with the first letter S in upper case.
TheSACHIN1992 3 months ago
@theflumpster try java.util.Scanner;
WoodenGraphics 2 months ago
i made a better calculator whit this tutorial that can do + - * / :D
hightemperaturegames 3 months ago
You're getting fewer and fewer views for every episode xD
Jshizzla 3 months ago
@Jshizzla Probably because some people give up so easily.
MinecraftCreators 3 months ago in playlist Java Programming Tutorials
This has been flagged as spam show
@MinecraftCreators That was kinda my point :P
Jshizzla 3 months ago
wow! Im getting the hang of this!
I even added a small feature to this on my own, thanks!
macbookfan33 3 months ago
does it matter if in:
public static void main(String[] args) if the [] is after "String" or after "args" becuase I have used it both ways.
Magnamite9 3 months ago in playlist Java Programming Tutorials
programmingandmore net
Check out this site if you want to learn programming, hacking, webmaster, graphics and more!
jumperxbl98 3 months ago
i edited the script a bit to make it say "your answer is..." then the answer and i also made it say addition calculator wt the top lol
DillonNProductions 3 months ago
The method nextDouble() is undefined for the type Scanner
WTF?
RSLegalizeeee 3 months ago
Check out our new programming forum:
programmingandmore net
Enjoy guys!
jumperxbl98 3 months ago
Java is for fags
pomfan45 3 months ago
@pomfan45 u sir are a fagdick
jakemichie97 3 months ago in playlist Java Programming Tutorials
Comment removed
vesavuori1999 3 months ago
Please can someone help me?
I am trying to make a quick program for minecraft that shows the id when you type in the block or item. But it doesnt work :S
import java.util.Scanner;
public class Class1 { public static void main (String args[]){ Scanner input = new Scanner (System.in); double stone; System.out.println ("Enter block/item:"); stone = input.nextDouble (); stone = 1; System.out.println (stone); }}
I am a noob at java an this would be my first program. :)
CnAxGaming 3 months ago
@CnAxGaming
That program should only print out the numder 1. If you remove the stone = 1; You would get the number you type in when you enter block/item. What is it you want the program to print out?
TheTorby 3 months ago