|
On May 28 2009 10:20 RaGe wrote: Lastly: Can you please tell me who the fuck you're sharing your account with that is making these dumbass statements? Apparently your IP has been static for days, and now it changes for every post you make about this problem. Aha! Clever, RaGe.
|
We're both working on the same thing, =/.
|
I don't see how that's even relevant anyways?
|
everything has been answered for you
stop acting like a douche yo
|
|
Calgary25963 Posts
You don't see why letting people log onto your account, using your veteran status to get answers, and then posting ridiculous flames is relevant?
|
You sure raped those bm'ing assholes but not actually reading their posts then replying!
|
|
import java.util.Scanner; public class UserInput{
public String done= "DONE";; public Scanner scan = new Scanner(System.in); public String scanned = ""; public UserInput(){
System.out.println("Type a string. Max 20 characters."); System.out.println("Type DONE, in all caps to end."); while(scanned.compareTo(done) != 0){ try{ scanned = scan.next(); if(scanned.length() > 20){ throw new StringTooLongException(); } System.out.println(scanned); } catch(StringTooLongException e){ System.out.println(e.getMessage()); System.out.println("Exception caught! Continuing..."); } } } }
Woot. Fixed! Learn English guys. Jesus christ. If you meant to put the ENTIRE TRYCATCH inside the while loop, then that'd have been nice. w00t@Abysdos being helpful, printStackTrace actually made me compare the two programs I had, and whee.
|
Hay RaGe why so cry to Nam instead of to me?
|
no
obviously we meant put the try statement both inside and outside the while loop, and the catch statement should be in another program altogether.
HOW COULD WE BE SO UNCLEAR!
|
I mean dear god
try and catch in the same scope
WHAT ARE YOU TRYING TO DO TO ME
|
Belgium9944 Posts
On May 28 2009 10:46 HeavOnEarth wrote: Hay RaGe why so cry to Nam instead of to me? Cause if you still don't understand what I wrote, you still don't understand how it works.
See you back when your next homework is due, cause I don't see you comprehending anything anytime soon.
edit: I mean, looking back, do you understand why your previous code didn't work? Why you needed to change the location of your try and catch blocks?
The mistake you made was assuming when an exception is thrown, after the catch block is executed, it resumes in the try block (which would completely ruin the function of try-catch blocks btw). I corrected that by literally saying it resumes after the catch block.
|
|
this is a terrible homework thread
1. code is unreadable 2. OP is stupid 3. OP doesnt know he's stupid
|
My friend's SFSkabam then.
|
wait... how the hell is this NOT homework?
|
it is, hence them both working on the same thing. He just figures if he lies about it he can keep his thread open
|
He lives in Oregon i live in Texas This is totally classwork for college. you got me man.
|
On May 28 2009 10:47 fusionsdf wrote: I mean dear god
try and catch in the same scope
WHAT ARE YOU TRYING TO DO TO ME
On May 28 2009 10:46 fusionsdf wrote: no
obviously we meant put the try statement both inside and outside the while loop, and the catch statement should be in another program altogether.
HOW COULD WE BE SO UNCLEAR! I know right? Jesus, if only everyone ALREADY knew Java! Then I wouldn't need to politely ask a fucking question, and have some piece of shit named RaGe basically passive flame me with bullshit statement such as "LAWL YOURNUB LERN 2 KNOW JAVA, WHY ASK QUESTION LOL YOU HAS PRINT LINE OHNOES."
On May 28 2009 10:51 RaGe wrote:Show nested quote +On May 28 2009 10:46 HeavOnEarth wrote: Hay RaGe why so cry to Nam instead of to me? Cause if you still don't understand what I wrote, you still don't understand how it works. See you back when your next homework is due, cause I don't see you comprehending anything anytime soon. Actually, this's the first problem I've had big enough problem to fucking post online. Probably not the last, but certainly the last for a long time.
On May 28 2009 10:52 mahnini wrote: this is a terrible homework thread
1. code is unreadable 2. OP is stupid 3. OP doesnt know he's stupid
1: Code is perfeclty indented, TL.net is just pathetic and doesn't know what a "tab" space is? 2: Rofl 3: Rofl these don't even deserve a comment.
On May 28 2009 10:51 RaGe wrote: edit: I mean, looking back, do you understand why your previous code didn't work? Why you needed to change the location of your try and catch blocks?
The mistake you made was assuming when an exception is thrown, after the catch block is executed, it resumes in the try block (which would completely ruin the function of try-catch blocks btw). I corrected that by literally saying it resumes after the catch block.
JESUS CHRIST, THAT'S EXACTLY WHAT I ASKED AT THE TOP?
ME: Firstly, the throw is inside a while loop. What I'm wondering is why the crap it isn't continuing the while loop, opposed to what it does now; which is ends the program. It should not be ending the program, it should be throwing an error, catching it, and then going back to the while loop.
Notice how I said "I'm wondering why ..." ? The first time I put trycatch inside a while loop I got a fucking runtime error in Eclipse.
ALSO IT'S NOT FUCKING HOMEWORK. IT'S HELP IN UNDERSTANDING. Fuck off.
|
|
|
|