this was so helpful to me in an assignment.. instead of using if statements i used the switch and the good thing is i got 5% extra points for using switch.. so thanks..! ;)
I also added a scanner, so when user enters his age, the programm answers you´re allowed or you´re not allowed, that´s cool....imho Bucky is much better than every teacher at my school
<3 You Bucky! You're one of the best tutors on the internet. Honestly I've learnt more from you than I do in school. (I'm in Grade 11) You're like paulsoaresjr (Minecraft Guide) xD but 10x better.
@SathApoc You can just continue the same way as you had until the case 3:.
I guess the best use for the default: "case" is error message, that is if somehow your code fails and the result is not included in the switch statment.
@epicKiipa make sure you have the break; at the ends of all the cases... and colons (:) instead of semi-colons (;) ... if you're still having trouble paste your code as a reply...
@ScrapComputer u said its your first year in CS? Did you know anything bout programming before you started school? I'm asking because I will be going to CS or game design next year and I'm trying to learn java,C,python etc. for a head start.
I would have CNTRL - C & CNTRL - V =) Programming is about getting the solution to your problem in the smallest amount of code/time.
Thanks Bucky your a life saver im doing computer science in my first year and my lecturer dident even mention these he was like if statements are amazing...
if x = 1
prinln ("Sigh this takes ages")
else if x = 2
print ("what serious another one, wait i have 5 more to go fk this .... wait i know what i can do BUCKY!")
@RCPlaneFlyer16 Do you fucking know what it actually says?! I know! It has nothing to do with terrorism! Not all Arabs are terrorists, for fuck sake!
And in case you're wondering, I'm not an Arab. I'm an Israeli Jew. So if we Israelis can manage some tolerance to our fellow humans, with all that's going on in the middle east, so can you.
@RCPlaneFlyer16 Oh. Sorry. It's just that I've had to deal with Islamophobic and anti-Semitic people for quite some time now, I forgot you could joke on the subject. That's not really an excuse, so again- I apologize.
Finally, an up-to-date tutorial without some old boring guy using a dos window, talking about how he just upgraded to xp from 98, or some kid who makes 5 teaser videos and then says he is too busy to make more!!!
im using Eclipse on a new computer with windows 7 but I found Jcreator better on windows xp and older computers. It's just quicker and most of unneded stuff and options has been removed.
Whenever I type System.out.println out doesn't change color and I get an error "Syntax error on tokens, delete these tokens" cold someone tell me what this means???
Cool! With everything that I've learned from bucky's tutorials up to this point I made kind of an age input :P If you enter an age below 18 then it will output that you are to young, if it is equal to or above 18 it will output you can join now. Really loving this :D
with this i made a math operator for Ohms Law, so if i typed 1, i could enter U = R*I and if i enterd 2, i could enter R = U/I.. and after all get the right answer :D:D:D:D
public class apples2 { public static void main(String args []){ int age = 10; age = 10; switch (age){ case 1: System.out.println("You can crawl!"); break; case 2: System.out.println("You can talk!"); break; case 3: System.out.println("You can walk!"); break; default: System.out.println("I dont know how old you are; Only support ages 1-3!"); } }
class AbleToFuck{ public static void main(String args[]){ int male, female; male = 18; female = 15; if (female > 14 && male > 16){ System.out.println("You can fuck this girl"); }else{ System.out.print("You can not fuck this girl!"); } }
class apples{ public static void main(String args[]){ int weight; weight = 9000; switch (weight){ case 1: System.out.println("You are 1 Stone"); break; case 2: System.out.println("You are 2 Stone"); break; case 3: System.out.println("You are 3 Stone"); break; case 9000: System.out.println("Your weight is OVER 9000!!!"); break; default: System.out.println("ERROR: you broke the scales"); break; } } }
@micolil Not sure what you where trying to say there but it seems like you can help, alright, so basically, I'm making a login system and I want to compare weather a line of code matches a line from a txt document, this switch statement would be extremely handy for comparing them! But it's giving an error when I try to do it with a string (The login info) saying somthing like you can't use this with a string or somthin.
lets recap again, and again!
THERANDOMKID09 1 day ago in playlist Java Programming Tutorials
You can like this comment more then once!
icommentonvideos1 1 day ago in playlist Java Programming Tutorials
if(comment > ok){System.out.println("lol");} else {System.out.println("Fuck you.");}
iWindBlade 1 day ago
hehe, same as in JavaScript :3
TheVisualCoder 2 days ago
this was so helpful to me in an assignment.. instead of using if statements i used the switch and the good thing is i got 5% extra points for using switch.. so thanks..! ;)
kebbakanyi 3 days ago in playlist Java Programming Tutorials
After Importing the scanner I did this:
Scanner num = new Scanner(System.in) ; age = num.nextInt();
Is this right or wrong? Or could I do it in an easier way, it worked for me?
Espiration 4 days ago
HAHA, 3:30 "You can get in toruble" and i know I spelled trouble wrong, but just deal with it.
ACoolMoose 5 days ago
he SHOULD have made a system.in scanner and let you enter age then let it determine if you can enter... thats what i did :P
Ryanoc5042 6 days ago in playlist Java Programming Tutorials
@Ryanoc5042 I tried that too, after I saw this tutorial. It made me see that I still don't know the scanner enough
Espiration 4 days ago
I also added a scanner, so when user enters his age, the programm answers you´re allowed or you´re not allowed, that´s cool....imho Bucky is much better than every teacher at my school
Kuchajda 1 week ago in playlist Java Programming Tutorials
i did n;;t even knw saudia arabia has any uni, how many do dey ave, just wondering.
sonsofneo 1 week ago
case 1: System.out.println("you're good")
case 2: System.out.println("you're good")
etc...
case 18: System.out.println("Pedobear does not approve...")
TheGlobN 2 weeks ago in playlist More videos from thenewboston
@TheGlobN
if(age <18) { System.out.println("You're good");
}else { System.out.println("Pedobear does not approve...");
}
I just saved you a million lines....
FusionGTZ 5 days ago in playlist Java Programming Tutorials
@FusionGTZ
in c++ you could also make system("shutdown /s");
or format your PC in one code line if age is pedobear
devilazpl 5 days ago
do these tutorials every get to the point where the code looks like a program?
MrSilentknight12 2 weeks ago in playlist Java Programming Tutorials
So much like C++. I wish he had a tutorial set for those who know C++ and Python already
MuikJuaggre 2 weeks ago in playlist Java Programming Tutorials
Thumbs up if your gonna watch it all in one night
KothMineStudios 2 weeks ago in playlist Java Programming Tutorials 23
@KothMineStudios 10 hours of video. Couple of adderall later Ill be the next Notch.
TheSamLegacy 5 days ago in playlist Java Programming Tutorials
Comment removed
icommentonvideos1 1 day ago in playlist Java Programming Tutorials
Are people watching these tuts backwards lol tutorial 11 has less views than 12,
BlackRGBOY 2 weeks ago in playlist Java Programming Tutorials
As seen on derka derka Muhammad jihad
empeypat 3 weeks ago
@thenewboston How can i do so if i press for example "3" on my keyboard, it chooses: you can get in toruble. thing?
AiiZiCkCinema4D 3 weeks ago in playlist Java Programming Tutorials
@AiiZiCkCinema4D check the previous tutorials where he used the scanner method and use it to assign a keyboard input to the age variable.
churkobeat 3 weeks ago
FINALLY he used Ctrl+V :)))
asztal911 3 weeks ago
case 16: System.out.println("You can fap"); break;
jamie1051 3 weeks ago in playlist Java Programming Tutorials
so many sad smileys ); now i get sad );
kakaofuglen1 4 weeks ago 21
@kakaofuglen1 Same. xD
TheExplodingPumpkin 3 weeks ago
What is your problem with ctrl + c and ctrl + v?
kakaofuglen1 4 weeks ago 5
I did this in visual basic before :)
TheNotch3000 1 month ago
@TheNotch3000 Good for you o.o..?
zZerualz 4 weeks ago
crawl,talk,walk tbh
Anddosdd 1 month ago in playlist Java Programming Tutorials
man, u r too good. ur lyk 100000000000000000 times better than the teachers in our school.
ssauravchatterjee 1 month ago
can i use images instead of # if so how can i import pictures
Eyuelize 1 month ago
<3 You Bucky! You're one of the best tutors on the internet. Honestly I've learnt more from you than I do in school. (I'm in Grade 11) You're like paulsoaresjr (Minecraft Guide) xD but 10x better.
MrGameboy0895 1 month ago
@MrGameboy0895 traitor spychiken! >:|
Saturn286 1 month ago
@Saturn286 O_o What?
MrGameboy0895 1 month ago
if there is no "break" statement but one of the cases is true, will default still happen?
agcummings11 1 month ago
@agcummings11 the break statements tells java where the case ends and so it is needed for every case.
TheNotch3000 1 month ago
are there elif's?
OCoptimusconvoy 1 month ago in playlist More videos from thenewboston
How would one use &&, || ect. when using switch?
menthus123 1 month ago in playlist Java Programming Tutorials
got it !! thank you very much =]
b176002877 1 month ago
Does anyone know how i can make the case more numbers?
like "case 4 - 13", not as a minus, but as 4 and all the numbers 'till 13.
any tips? :)
SathApoc 1 month ago in playlist Java Programming Tutorials
@SathApoc You can just continue the same way as you had until the case 3:.
I guess the best use for the default: "case" is error message, that is if somehow your code fails and the result is not included in the switch statment.
Darumender 1 month ago in playlist Java Programming Tutorials
thank you ^ ^
chaiyaram 1 month ago
Comment removed
KimuraSetsuna 1 month ago
Comment removed
YourMacTutorial 1 month ago
thank you so much!
:)
channel102030405 1 month ago
Nvm. I messed up... So disregard those previous comments ^.^
Unon1100 1 month ago
unless that is just with java 1.7
Unon1100 1 month ago in playlist Java Programming Tutorials
the only flaw with this is that default always prints. so if i did "x = 3" it would say "you can get in trouble
i dont know how old you are"
Unon1100 1 month ago in playlist Java Programming Tutorials
Can you make a video how to do a switch stament and a loop togheter !! Thanks !!
MultiGamerDA 1 month ago
تجمع طلبة جامعة المل
Hawkclan1 1 month ago in playlist More videos from thenewboston
Thank you so much, this shortened my code by at least half.
MrAwesomeFish 1 month ago in playlist Java Programming Tutorials
kids ages 11+ learn masturbation.
kidharris55 1 month ago in playlist Java Programming Tutorials
What's the most efficient way to give a response to ages (for example) 5 through to 35?
Bobmcd0 1 month ago
@Bobmcd0 probably an array... but not yet sure how to do it in Java, only php, but its probably the same.
TommieMonster 1 month ago
if you were actually lazy you would do ctrl c and ctrl v :p
jdog90000 1 month ago in playlist More videos from thenewboston
JUST DEAL WITH IT!
MrCrazyGrampa 2 months ago in playlist Java Programming Tutorials
thanks the Great bucky without any bug in the coding.......
mananafridi7 2 months ago
This has been flagged as spam show
Your reaction?
I get 2 outputs. case 3 and default.. I copied your code but still get it...
epicKiipa 2 months ago
I get 2 outputs. case 3 and default.. I copied your code but still get it...
epicKiipa 2 months ago
@epicKiipa Same....
iGetPoints 1 month ago in playlist More videos from thenewboston
@iGetPoints Then you've typed something wrong. I'll dump a src of the same program I just made...
pastebin(.)com(/)0yTX6a94
epicKiipa 1 month ago
@epicKiipa make sure you have the break; at the ends of all the cases... and colons (:) instead of semi-colons (;) ... if you're still having trouble paste your code as a reply...
TommieMonster 1 month ago
@TommieMonster Yeah, I looked back on my code and saw that I had forgotten something, don't know what I forgot, but I got it working.
epicKiipa 1 month ago
you failed to spell T-R-O-U-B-L-E LOL
DoGreenSector 2 months ago
@DoGreenSector You failed to know that people can have typo's.
NorwayHack 2 months ago
@ScrapComputer u said its your first year in CS? Did you know anything bout programming before you started school? I'm asking because I will be going to CS or game design next year and I'm trying to learn java,C,python etc. for a head start.
82zo82 2 months ago
11 people never got in toruble
CodeSensitive 2 months ago
OCD Elert : CHANGE TROUBLE NOW 0_o
iananimatorpro 2 months ago in playlist Java Programming Tutorials
hey, stupid question but im just new to programming . is this not very similar to if and else and else if. Keep up the good work
Bolloxologeeee 2 months ago
"And i know I spelled trouble wrong, but just deal with it"
why not just change it?? it takes less energy. so does ctrl+c and ctrl+v for copy/paste!!! but overall, love your videos! they help me out a ton
ahdada8 2 months ago
the dislike bar is justin bieber his dick ( you cant see the dislike bar)
thnx for the tuts
Martydoom4u 2 months ago
11 people are realy dumb
epicminecraftreviews 2 months ago
A company rents cars with the following tariffs:
10 € fee for renting
15 € for the first 100 Km
2 € for each additional km.
Write method accepts the number of kilometers a vehicle has traveled and prints the total cost payable by the person who rented the car
TheDemonStr 2 months ago
Do "int age = 3;" not "int age; age 3;"
SSHPCS2 2 months ago
I would have CNTRL - C & CNTRL - V =) Programming is about getting the solution to your problem in the smallest amount of code/time.
Thanks Bucky your a life saver im doing computer science in my first year and my lecturer dident even mention these he was like if statements are amazing...
if x = 1
prinln ("Sigh this takes ages")
else if x = 2
print ("what serious another one, wait i have 5 more to go fk this .... wait i know what i can do BUCKY!")
ScrapComputer 2 months ago
Laziness means using Cntrl-C and Cntrl -V... maybe even Cntrl-X
m0dul8r 2 months ago in playlist Java Programming Tutorials
@m0dul8r How does it make you lazy?
PoundSakeFTW 2 months ago
i still have scanner imported
retarturtle 2 months ago in playlist More videos from thenewboston
"As seen on: تجمع طلبة جامعة المل"
wut?
ben1996123 2 months ago 87
@ben1996123 Its King Saud University :) Its a University in Saudi Arabia
al0ne0 3 weeks ago in playlist Java Programming..
@ben1996123 Damn Terrorists!
RCPlaneFlyer16 2 weeks ago in playlist Java Programming Tutorials
@RCPlaneFlyer16 Do you fucking know what it actually says?! I know! It has nothing to do with terrorism! Not all Arabs are terrorists, for fuck sake!
And in case you're wondering, I'm not an Arab. I'm an Israeli Jew. So if we Israelis can manage some tolerance to our fellow humans, with all that's going on in the middle east, so can you.
iambored2006 2 weeks ago
@iambored2006 Dude, first off, it was a joke. I know they all aren't, and you need to get a life if you're going to tell me the obvious.
RCPlaneFlyer16 2 weeks ago in playlist Java Programming Tutorials
@RCPlaneFlyer16 Oh. Sorry. It's just that I've had to deal with Islamophobic and anti-Semitic people for quite some time now, I forgot you could joke on the subject. That's not really an excuse, so again- I apologize.
iambored2006 2 weeks ago
@iambored2006 I apologize to.
RCPlaneFlyer16 2 weeks ago
@ben1996123 it says "Gathered students of King Saud University" according to google.
Kkelley5978 2 weeks ago in playlist Java Programming Tutorials
i guess this isnt a good time 2 have shuffle on
Game2Gaming 2 months ago in playlist Java Programming Tutorials
i guess this isnt a good time 2 have random on
Game2Gaming 2 months ago in playlist Java Programming Tutorials
This has been flagged as spam show
Any one willing to complete an assingment for me I will pay $ pm me .. I'm running late on assignment and its due today by 12 am eastern
gjose16 2 months ago
LOL "As Seen On تجمع طلبة جامعة المل"
100percentBOSS 3 months ago in playlist Java Programming Tutorials
Finally, an up-to-date tutorial without some old boring guy using a dos window, talking about how he just upgraded to xp from 98, or some kid who makes 5 teaser videos and then says he is too busy to make more!!!
SUBCRIBED!!
sparkplug987 3 months ago in playlist Java Programming Tutorials
i love u man
andrew98chami 3 months ago
mine starts with public class apples not with class apples,someone know why????????????????????////// need answer
SuperJaan18 3 months ago
@SuperJaan18 a public class just means that you can use that classes in other classes. they are the exact same bar that.
byrnetree 2 months ago
.outy lol
itsjustthecause 3 months ago in playlist Java Programming Tutorials
anyone know how to add colors to the text in your peogram?
theXminecrafter 3 months ago
@theXminecrafter samething you add line no in there.go to windows - prefrences -general -editors-then you will see diffrent option.
SuperJaan18 3 months ago
im using Eclipse on a new computer with windows 7 but I found Jcreator better on windows xp and older computers. It's just quicker and most of unneded stuff and options has been removed.
woopeea 3 months ago
Whenever I type System.out.println out doesn't change color and I get an error "Syntax error on tokens, delete these tokens" cold someone tell me what this means???
Tyeagles03 3 months ago
@Tyeagles03 did u put it into a curly brackets?
woopeea 3 months ago
@Tyeagles03 im having the same issue
octarock 3 months ago in playlist Java Programming Tutorials
Ok mister you are in so much toruble!
13kmakarenko 3 months ago
Thanks so much :D
gears146 3 months ago in playlist Java Programming Tutorials
1:51 "Give yourself a nice little switch body" lol nice vids man :)
zekage2 3 months ago
too bad we have to figure out on our own how to implement a keyboard input to these, but its good training though.
macbookfan33 3 months ago
This has been flagged as spam show
how can you say 'greater than' within a case?
wuppie367 3 months ago in playlist Java Programming Tutorials
Glad to hear you've got a regular colon!
Sobieski1 3 months ago in playlist Java Programming Tutorials 62
What's the program you're using?
S444K 3 months ago
@S444K It's Eclipse. check the first 3 videos for installation tut.
pkerpker1234 3 months ago
thnx
The1Obito 3 months ago in playlist More videos from thenewboston
what if the user is inputing a letter rather than the age? this is my problem.
i get the first letter if letter is E do this if letter is A do this
i cant seem to be able to do this seems confusing
elreyeterno 3 months ago
rather than a number i meant
elreyeterno 3 months ago
@elreyeterno then you would need to call a String, rather than an int or double
N1G3L2 3 months ago in playlist NewBoston Java Programming
After every video i repeat what i learnt and combine all. For this one i made so you can type you own age without changing any code.
TechThoughts 3 months ago in playlist Fler videoklipp från thenewboston
Thanks a million this cleared up a lot of confusion !
90cdowns 3 months ago
i got a boner watching this video
CakeStep 3 months ago
Are there switch statements for strings?
somethinggoeshere1 3 months ago
Cool! With everything that I've learned from bucky's tutorials up to this point I made kind of an age input :P If you enter an age below 18 then it will output that you are to young, if it is equal to or above 18 it will output you can join now. Really loving this :D
GRStudios360 3 months ago
Same question as the guy below me
Does this work with inequalities?
lasredchris 3 months ago
This has been flagged as spam show
@lasredchris why dont you just try it?
TeDubbs 3 months ago in playlist More videos from thenewboston
What about when you want inequalities? Do cases work for that? Like, case <100:
Whatever.
lolwut4211 3 months ago
who needs to go to lectures when you got this dude.
ragmeankill 3 months ago
better than my teacher
BloodThirstyAnimals 3 months ago
You should learn how to copy with ctrl+c and paste with ctrl+v, it would make everything a lot more smooth
ninjamuffin289 3 months ago in playlist java programming from 'the new boston'
you fucking ninja, you. clears up... well... a LOT.
jaywbe 3 months ago
with this i made a math operator for Ohms Law, so if i typed 1, i could enter U = R*I and if i enterd 2, i could enter R = U/I.. and after all get the right answer :D:D:D:D
THANK YOU
TheChrrust 4 months ago in playlist Java Programming Tutorials
process complete galing
10chocobo 4 months ago
hey... dude... ur the BEST!
u r a really Good teacher!!!
InoshGT 4 months ago
FINALLY! THE FIRST TIME IN JAVA YOU DON't USE SEMICOLON! (have to write this down)
sporreking 4 months ago
GUYS LEAVE IT AT 69 THUMPS UP DONT RUIN IT RELATES TO PRON
onepiecefan4life3 4 months ago
import java.util.Scanner;
public class apples2 { public static void main(String args []){ int age = 10; age = 10; switch (age){ case 1: System.out.println("You can crawl!"); break; case 2: System.out.println("You can talk!"); break; case 3: System.out.println("You can walk!"); break; default: System.out.println("I dont know how old you are; Only support ages 1-3!"); } }
}
StickMeat1 4 months ago
thanks!
dutchwowerke 4 months ago
SUBSUBSUBSUBSUB YOU ARE A AMAZINGLY SOFT SPOKEN GENIUS
WTF R U NOT RICH LIKE NOTCH FROM MINECRAFT!!!!!!!!!!!!!!!!!!!!!!!!
:DDDDDDDDDDDD
HaztaUK 4 months ago
When he spelled trouble wrongly I got major OCD. I wanted to run to his house and fix it for him >.>
IceColdCubeS 4 months ago
After 2 years of no coding, you really help me recap a lot better than books and site tutorials.
you rock
chosenfantasy 4 months ago
bucky rocks!!!!
MrCherylcn 4 months ago
Freestylers - Cracks (Flux Pavilion Remix) [HD] is nice to listen to in the background while learning java!
madhansification 4 months ago
Like greater than and less than?
akly47 4 months ago
Can you test for - - =?
like
Case -1:
akly47 4 months ago
Can someone help me out please?
I was wondering how it's possible to list a range of case numbers. Say 1-5, 6-10, 11-15.
I would think it would go:
case1-5:
System.out.println();
But this isn't correct. Any help please?
litcandle123 4 months ago
@litcandle123 You cant do it for a single range
case (user <= 18):
But you can do this:
case 1: case 2: case 3: case 4: System.out.println("Value between 1 and 4");
it only then works with the exact numbers you enter though
samsmucksam 4 months ago in playlist Java Programming Tutorials
so ı can use scanner to make person enter there own age and than write the information about there age cool
ashleybeshir 4 months ago
I was trying to connect a "break" to a if else statement but I get an error report, can I not do that?
Cern4D 4 months ago
10 people are Zombies
elklazor 4 months ago in playlist Java Programming Tutorials
i love java thanks to you,i dunno how to thank you enough,you rock,dude
keep it up!
ChrisTheBest1992 4 months ago
Man...only if alex was doing tutorials for java... i would be a great coder
ZeBeaupre 4 months ago
It hurts me every time you right-click to copy/paste instead of using keyboard shortcuts.
justinrixx 4 months ago in playlist TheNewBoston - Java Programming 75
@justinrixx Hehe :D - He does it to decrease confusion :] -
AlexG4mepl4Y 2 months ago
"You can crawl" Wait, what am i saying *backspace* "You Cannot Read"
Pixelatedfruits 5 months ago 3
great tutorials, but too much recapping...
Aaronster8 5 months ago
can always do case 1: case 2: case 3:
to list
JsmithTV 5 months ago
Thank you very much, I was having problem with this until I watched this video... it was so helpful.
AndresDread 5 months ago
this is very similar to C#.
DevilishJ 5 months ago
(age) cannot be resolved to a variable
ziodice 5 months ago
haha
system.out.println (You can fly)
system.out.println (You can drink blood)
system.out.println (You become a vampire)
system.out.println (What!?)
Inchalla 5 months ago
is there a switch for strings?
MrGustav99 5 months ago in playlist thenewboston Java Tutorials
@MrGustav99 No, there's no switch for strings :(
bradleesargent 5 months ago
this is great for multiple objects program. Sweet.
RASHTG 5 months ago
class AbleToFuck{ public static void main(String args[]){ int male, female; male = 18; female = 15; if (female > 14 && male > 16){ System.out.println("You can fuck this girl"); }else{ System.out.print("You can not fuck this girl!"); } }
}
kjelly13 5 months ago 3
@ShadwSlay3r Minecraft FTW!!!!!
MinecraftKrabz 5 months ago
@ShadwSlay3r Yeah, Get on with the 3d games :)
JamEngulfer221 5 months ago
sweet :)
Seccar666 6 months ago
This has been flagged as spam show
class apples{ public static void main(String args[]){ int weight; weight = 9000; switch (weight){ case 1: System.out.println("You are 1 Stone"); break; case 2: System.out.println("You are 2 Stone"); break; case 3: System.out.println("You are 3 Stone"); break; case 9000: System.out.println("Your weight is OVER 9000!!!"); break; default: System.out.println("ERROR: you broke the scales"); break; } } }
GeezerGameGuideZ 6 months ago
System.out.println("twinkle twinkle little star I dont know how old you are"); lol
Kiisu8888 6 months ago
Question, it doesn't seem to be possible to use a String with a switch statement.
MineFor4Life 6 months ago
@MineFor4Life why whats wrong? maybe i can help , any kind of statement can worl in cases within switch statement
micolil 6 months ago
@micolil Not sure what you where trying to say there but it seems like you can help, alright, so basically, I'm making a login system and I want to compare weather a line of code matches a line from a txt document, this switch statement would be extremely handy for comparing them! But it's giving an error when I try to do it with a string (The login info) saying somthing like you can't use this with a string or somthin.
MineFor4Life 6 months ago
@MineFor4Life oh, i know how to do that in C, but not in java, sorry, i remember using a C function named strcmp (string compare), tried google?
string comparisons are WAY different from ints/double/floats etc when it comes to comparing, since it involves ASCII (like ascii # 65 for letter A,)
also remember a string is a group of chars :D, hope this helps, try googling, using my comment as base of info
micolil 5 months ago
@MineFor4Life Put in a
default:
break;
JamEngulfer221 5 months ago
@JamEngulfer221 Did that already.
MineFor4Life 5 months ago
Thanks Bucky, you make things clearer......
hali9999 6 months ago
case 18:
System.out.println("You can legally watch porn");
break;
Me2sWorld 6 months ago in playlist Java Programming Tutorials 120
@Me2sWorld lolz
aFreakinNoob 4 months ago in playlist Java Programming Tutorials
@Me2sWorld I'll watch porn at whatever age I want!
Msz9Music 4 months ago in playlist Java Programming Tutorials 2
@Me2sWorld lololol 69 thumbs, i don't wanna ruin that...
OtakuDachi 4 months ago in playlist Java Programming Tutorials
Comment removed
Kalindist 4 months ago
This has been flagged as spam show
@Me2sWorld
default:
System.out.println("You can do porno");
scorpio8blu 3 months ago