• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 14:51
CEST 20:51
KST 03:51
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
RSL Season 1 - Final Week6[ASL19] Finals Recap: Standing Tall12HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0
Community News
Esports World Cup 2025 - Brackets Revealed10Weekly Cups (July 7-13): Classic continues to roll4Team TLMC #5 - Submission extension3Firefly given lifetime ban by ESIC following match-fixing investigation17$25,000 Streamerzone StarCraft Pro Series announced7
StarCraft 2
General
The GOAT ranking of GOAT rankings RSL Revival patreon money discussion thread Who will win EWC 2025? Weekly Cups (July 7-13): Classic continues to roll Esports World Cup 2025 - Brackets Revealed
Tourneys
FEL Cracov 2025 (July 27) - $8000 live event RSL: Revival, a new crowdfunded tournament series $5,100+ SEL Season 2 Championship (SC: Evo) WardiTV Mondays Sparkling Tuna Cup - Weekly Open Tournament
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
External Content
Mutation # 482 Wheel of Misfortune Mutation # 481 Fear and Lava Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome
Brood War
General
Flash Announces (and Retracts) Hiatus From ASL BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion Starcraft in widescreen A cwal.gg Extension - Easily keep track of anyone
Tourneys
[Megathread] Daily Proleagues Cosmonarchy Pro Showmatches CSL Xiamen International Invitational [BSL20] Non-Korean Championship 4x BSL + 4x China
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile Nintendo Switch Thread CCLP - Command & Conquer League Project The PlayStation 5
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Future of Porn Stop Killing Games - European Citizens Initiative Summer Games Done Quick 2025!
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread [\m/] Heavy Metal Thread
Sports
Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023 2024 - 2025 Football Thread NBA General Discussion NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Men Take Risks, Women Win Ga…
TrAiDoS
momentary artworks from des…
tankgirl
from making sc maps to makin…
Husyelt
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 745 users

Homework thread - Page 3

Forum Index > Closed
Post a Reply
Prev 1 2 3 4 5 Next All
fusionsdf
Profile Blog Joined June 2006
Canada15390 Posts
May 28 2009 02:01 GMT
#41
On May 28 2009 09:54 RaGe wrote:
Maybe you should stop being so defensive and read the fucking solution for a change.

Show nested quote +
On May 28 2009 09:38 RaGe wrote:
When an exception gets thrown, it immeadiately skips to the Catch, which is at the end of your program, so it terminates the program cause there's no following lines of code



Your catch block is outside of the while loop, so it doesn't continue in the while loop after it executes the catch block. Java does not magically read your mind. This wasn't supposed to work. This isn't some obscure error. This is you skipping through whatever 'How to handle exceptions' guide you read, copy pasting some stupid shit that you don't understand, and asking tl to fix your errors.



seems like he answered the question pretty obviously to me
SKT_Best: "I actually chose Protoss because it was so hard for me to defeat Protoss as a Terran. When I first started Brood War, my main race was Terran."
HeavOnEarth
Profile Blog Joined March 2008
United States7087 Posts
May 28 2009 02:02 GMT
#42
.. so RaGe agrees , to argue with SFSkabam .. and you ban him before RaGe even replies?
"come korea next time... FXO house... 10 korean, 10 korean"
HeavOnEarth
Profile Blog Joined March 2008
United States7087 Posts
May 28 2009 02:03 GMT
#43
o noz lets not even address any points of his new post and just ban him
"come korea next time... FXO house... 10 korean, 10 korean"
mahnini
Profile Blog Joined October 2005
United States6862 Posts
May 28 2009 02:03 GMT
#44
i dunno maybe you should take the time to properly indent the code if you want people to take the time to read it. might want to give it some white space too
the world's a playground. you know that when you're a kid, but somewhere along the way everyone forgets it.
HeavOnEarth
Profile Blog Joined March 2008
United States7087 Posts
May 28 2009 02:04 GMT
#45
I mean jesus christ, have you read the begginning of the thread? RaGe started posting shit , pretty much unprovoked as far as i can tell
"come korea next time... FXO house... 10 korean, 10 korean"
aers *
Profile Joined January 2009
United States1210 Posts
May 28 2009 02:04 GMT
#46
it should be throwing an error, catching it, and then going back to the while loop.


Your problem is this is wrong. That's not how try/catch loops work. That is exactly what RaGe pointed out in his first post.

1) try <something>
2) throw exception
3) catch exception
4) execution continues after try/catch block
Chill
Profile Blog Joined January 2005
Calgary25980 Posts
May 28 2009 02:04 GMT
#47
His first post was talking shit to a moderator, so yes, I ban him.
His "real" first post was showing no humility and talking shit to people trying to help him.
Moderator
HeavOnEarth
Profile Blog Joined March 2008
United States7087 Posts
May 28 2009 02:05 GMT
#48
On May 28 2009 11:03 mahnini wrote:
i dunno maybe you should take the time to properly indent the code if you want people to take the time to read it. might want to give it some white space too

can we drop this
read the thread before you post
here it is for you
On May 28 2009 10:02 Abydos1 wrote:
Show nested quote +
On May 28 2009 10:01 Malongo wrote:
HOE I have a suggestion to make life easier to you:
Identation: helps to find easily where your code blocks belong, I hate to see a code that ends in 3/4 brackets and I dont know where the fuck they belong.



fyi, it is indented but quote doesn't show them correctly.

"come korea next time... FXO house... 10 korean, 10 korean"
Elemenope
Profile Blog Joined March 2006
Burkina Faso1704 Posts
May 28 2009 02:06 GMT
#49
On May 28 2009 11:04 HeavOnEarth wrote:
I mean jesus christ, have you read the begginning of the thread? RaGe started posting shit , pretty much unprovoked as far as i can tell



On May 28 2009 09:38 RaGe wrote:
When an exception gets thrown, it immeadiately skips to the Catch, which is at the end of your program, so it terminates the program cause there's no following lines of code

program is doing what you made it to do lol




Yeah man, that was quite posting shit, much unprovoked as far as I can tell too.
In DotA you could
Abydos1
Profile Blog Joined October 2008
United States832 Posts
May 28 2009 02:07 GMT
#50
http://lmgtfy.com/?q=java exceptions&l=1

Learn to do some basic searching first...
"...perhaps the greatest joy possible in Starcraft, being accused of being a maphacker" - Day[9]
mahnini
Profile Blog Joined October 2005
United States6862 Posts
Last Edited: 2009-05-28 02:08:28
May 28 2009 02:07 GMT
#51
[ indent ]

makes it 10x easier to read and shows some effort at least. anyway, doesnt really matter cause people sifter through the code anyway and told him what was wrong and he spazzed out.
the world's a playground. you know that when you're a kid, but somewhere along the way everyone forgets it.
So no fek
Profile Blog Joined June 2005
United States3001 Posts
May 28 2009 02:07 GMT
#52
On May 28 2009 11:06 Elemenope wrote:
Show nested quote +
On May 28 2009 11:04 HeavOnEarth wrote:
I mean jesus christ, have you read the begginning of the thread? RaGe started posting shit , pretty much unprovoked as far as i can tell



Show nested quote +
On May 28 2009 09:38 RaGe wrote:
When an exception gets thrown, it immeadiately skips to the Catch, which is at the end of your program, so it terminates the program cause there's no following lines of code

program is doing what you made it to do lol




Yeah man, that was quite posting shit, much unprovoked as far as I can tell too.


I'd assume he's talking about Rage's second post, which is a small bit on the offense, however, the way the OP handled it from there... /facepalm
#1 Shuttle fan - TeamLiquid CJ Entusman #36 BW4lyfe
ThaddeusK
Profile Joined July 2008
United States231 Posts
May 28 2009 02:07 GMT
#53
rage's first post answered the OP perfectly, shouldve just been closed after it >.>
Chill
Profile Blog Joined January 2005
Calgary25980 Posts
Last Edited: 2009-05-28 02:09:30
May 28 2009 02:08 GMT
#54
Yes I agree Rage escillated it unprovoked. But it's pretty obvious that:
1) You martyr yourself in the first post (slap to moderators' face).
2) It's obviously homework.
3) You don't know what you're doing.

Had you approached with humility and addressed the above three points, we wouldn't be in this situation. Yes, Rage should have been more forgiving and not attacked you/your friend, but after being clearly proven wrong your friend degraded into just insulting everyone. That doesn't fly here.
Moderator
HeavOnEarth
Profile Blog Joined March 2008
United States7087 Posts
May 28 2009 02:08 GMT
#55
On May 28 2009 11:06 Elemenope wrote:
Show nested quote +
On May 28 2009 11:04 HeavOnEarth wrote:
I mean jesus christ, have you read the begginning of the thread? RaGe started posting shit , pretty much unprovoked as far as i can tell



Show nested quote +
On May 28 2009 09:38 RaGe wrote:
When an exception gets thrown, it immeadiately skips to the Catch, which is at the end of your program, so it terminates the program cause there's no following lines of code

program is doing what you made it to do lol




Yeah man, that was quite posting shit, much unprovoked as far as I can tell too.


wow i get more and more convinced you have no idea what you're doing and just copy pasted shit

it's not copy pasted?
at this point he's insulting me as well ; not just my friend

IN response to this
On May 28 2009 09:49 HeavOnEarth wrote:
Show nested quote +
On May 28 2009 09:38 RaGe wrote:
When an exception gets thrown, it immeadiately skips to the Catch, which is at the end of your program, so it terminates the program cause there's no following lines of code

program is doing what you made it to do lol


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.

Show nested quote +
On May 28 2009 09:44 RaGe wrote:
wow i get more and more convinced you have no idea what you're doing and just copy pasted shit or something

i mean, your catch block is:

catch(StringTooLongException e){
System.out.println(e.getMessage());
System.out.println("Exception caught! Ending program.");
}


you even print that you're ending the program and you dont want it to end the program?


Oh noes, I has a random print line that hasn't been changed from a previous version. Printing text doesn't end a program. ... (At least not this one)


Rage posts
Maybe you should stop being so defensive and read the fucking solution for a change.

"come korea next time... FXO house... 10 korean, 10 korean"
wesbrown
Profile Joined March 2008
United States31 Posts
Last Edited: 2009-05-28 02:12:36
May 28 2009 02:09 GMT
#56
If you're only using the try/catch block to look for StringTooLongExceptions before printing the input string, you can do this without obfuscating the code by using continue.



+ Show Spoiler +

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...");
}
}
}

}


becomes

+ Show Spoiler +

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){
scanned = scan.next();
if(scanned.length() > 20){
System.out.println("Input String was too long.");
continue;
}
System.out.println(scanned);
}
}

}



Note that I'm not familiar with the Scanner class, but it doesn't look like it should throw exceptions based on your code. Given that, there is no reason to use a try/catch block.

http://java.sun.com/docs/books/tutorial/java/nutsandbolts/branch.html
ChillIsPathetic
Profile Joined May 2009
1 Post
May 28 2009 02:10 GMT
#57
Chill you're naught but a pathetic power hungry 13 year old? I like how I get BM'd first, and I'm the bad guy. Rofl.
Seriously, almost the entire TL.net community is fucking trash, including the mods. Seriously, why was Kawaii so pissed about this pathetic site.

Lawl, banned:
Reason: Incosiderate newb. Try harder on your next account.

There will be no more accounts (other than this one)? This site was trash the first time I used it, and it was again, even on Nam's account when I was extremely fucking GM. First some pathetic piece of shit mod closes the first thread, and then I get lawl'd by RaGe, who gains a fuckton of retards behind him? Seriously, you people need to burn at the stake.
Rof. This site is trash, and so are the mods apparently?
HeavOnEarth
Profile Blog Joined March 2008
United States7087 Posts
May 28 2009 02:10 GMT
#58
On May 28 2009 11:08 Chill wrote:
Yes I agree Rage escillated it unprovoked. But it's pretty obvious that:
1) You martyr yourself in the first post (slap to moderators' face).
2) It's obviously homework.
3) You don't know what you're doing.

Had you approached with humility and avoided the above three points, we wouldn't be in this situation. Yes, Rage should have been more forgiving and not attacked you/your friend, but after being clearly proven wrong your friend degrading into just insulting everyone. That doesn't fly here.

3)He didn't even have a chance to explain what he understands and RaGe shits all over him on it?

2)How is trying to understand something homework- we already posted the code, hell we fixed it as well.
"come korea next time... FXO house... 10 korean, 10 korean"
Abydos1
Profile Blog Joined October 2008
United States832 Posts
May 28 2009 02:10 GMT
#59
Indenting (and syntax highlighting) since TL doesn't do it...

http://pastebin.com/m6e7a70d8
"...perhaps the greatest joy possible in Starcraft, being accused of being a maphacker" - Day[9]
Chill
Profile Blog Joined January 2005
Calgary25980 Posts
May 28 2009 02:11 GMT
#60
On May 28 2009 11:08 HeavOnEarth wrote:
Show nested quote +
On May 28 2009 11:06 Elemenope wrote:
On May 28 2009 11:04 HeavOnEarth wrote:
I mean jesus christ, have you read the begginning of the thread? RaGe started posting shit , pretty much unprovoked as far as i can tell



On May 28 2009 09:38 RaGe wrote:
When an exception gets thrown, it immeadiately skips to the Catch, which is at the end of your program, so it terminates the program cause there's no following lines of code

program is doing what you made it to do lol




Yeah man, that was quite posting shit, much unprovoked as far as I can tell too.

Show nested quote +

wow i get more and more convinced you have no idea what you're doing and just copy pasted shit

it's not copy pasted?
at this point he's insulting me as well ; not just my friend

IN response to this
Show nested quote +
On May 28 2009 09:49 HeavOnEarth wrote:
On May 28 2009 09:38 RaGe wrote:
When an exception gets thrown, it immeadiately skips to the Catch, which is at the end of your program, so it terminates the program cause there's no following lines of code

program is doing what you made it to do lol


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.

On May 28 2009 09:44 RaGe wrote:
wow i get more and more convinced you have no idea what you're doing and just copy pasted shit or something

i mean, your catch block is:

catch(StringTooLongException e){
System.out.println(e.getMessage());
System.out.println("Exception caught! Ending program.");
}


you even print that you're ending the program and you dont want it to end the program?


Oh noes, I has a random print line that hasn't been changed from a previous version. Printing text doesn't end a program. ... (At least not this one)

Show nested quote +

Rage posts
Maybe you should stop being so defensive and read the fucking solution for a change.


I can't even program and I understand what Rage says. Exception thrown = goto catch. Your friend doesn't address this point at all. So Rage says l2read.
Moderator
Prev 1 2 3 4 5 Next All
Please log in or register to reply.
Live Events Refresh
WardiTV European League
16:00
Swiss Groups Day 4
WardiTV1046
TKL 317
IndyStarCraft 279
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mouzHeroMarine 536
TKL 317
IndyStarCraft 279
UpATreeSC 154
BRAT_OK 75
MindelVK 35
StarCraft: Brood War
EffOrt 687
Rush 615
BeSt 354
firebathero 346
Larva 60
PianO 52
Movie 42
sas.Sziky 26
Aegong 26
JulyZerg 23
[ Show more ]
yabsab 15
sSak 8
SilentControl 5
Dota 2
qojqva3888
canceldota66
League of Legends
Grubby3649
febbydoto2
Counter-Strike
pashabiceps1218
flusha283
Heroes of the Storm
Liquid`Hasu137
Other Games
FrodaN4790
ceh9685
Beastyqt644
mouzStarbuck167
oskar140
Skadoodle127
elazer109
C9.Mang0106
ArmadaUGS83
Mew2King62
QueenE60
Trikslyr60
Organizations
Other Games
gamesdonequick3392
StarCraft 2
angryscii 9
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 18 non-featured ]
StarCraft 2
• davetesta20
• intothetv
• sooper7s
• Migwel
• AfreecaTV YouTube
• LaughNgamezSOOP
• IndyKCrew
• Kozan
StarCraft: Brood War
• 80smullet 18
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 2615
League of Legends
• Nemesis2831
• Jankos2095
• TFBlade829
Other Games
• imaqtpie1765
• Shiphtur217
Upcoming Events
PiGosaur Monday
5h 9m
uThermal 2v2 Circuit
21h 9m
Replay Cast
1d 5h
The PondCast
1d 15h
WardiTV European League
1d 21h
Replay Cast
2 days
Epic.LAN
2 days
CranKy Ducklings
3 days
Epic.LAN
3 days
CSO Contender
3 days
[ Show More ]
BSL20 Non-Korean Champi…
3 days
Bonyth vs Sziky
Dewalt vs Hawk
Hawk vs QiaoGege
Sziky vs Dewalt
Mihu vs Bonyth
Zhanhun vs QiaoGege
QiaoGege vs Fengzi
Sparkling Tuna Cup
4 days
Online Event
4 days
BSL20 Non-Korean Champi…
4 days
Bonyth vs Zhanhun
Dewalt vs Mihu
Hawk vs Sziky
Sziky vs QiaoGege
Mihu vs Hawk
Zhanhun vs Dewalt
Fengzi vs Bonyth
Esports World Cup
6 days
ByuN vs Astrea
Lambo vs HeRoMaRinE
Clem vs TBD
Solar vs Zoun
SHIN vs Reynor
Maru vs TriGGeR
herO vs Lancer
Cure vs ShoWTimE
Liquipedia Results

Completed

2025 ACS Season 2: Qualifier
RSL Revival: Season 1
Murky Cup #2

Ongoing

JPL Season 2
BSL 2v2 Season 3
Copa Latinoamericana 4
Jiahua Invitational
BSL20 Non-Korean Championship
Championship of Russia 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters

Upcoming

CSL Xiamen Invitational
CSL Xiamen Invitational: ShowMatche
2025 ACS Season 2
CSLPRO Last Chance 2025
CSLPRO Chat StarLAN 3
BSL Season 21
K-Championship
RSL Revival: Season 2
SEL Season 2 Championship
uThermal 2v2 Main Event
FEL Cracov 2025
Esports World Cup 2025
Underdog Cup #2
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.