Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Paul Clapham
Ron McLeod
Jeanne Boyarsky
Tim Cooke
Sheriffs:
Liutauras Vilda
paul wheaton
Henry Wong
Saloon Keepers:
Tim Moores
Tim Holloway
Stephan van Hulst
Carey Brown
Frits Walraven
Bartenders:
Piet Souris
Himai Minh
Forum:
Beginning Java
processLine
E Jen
Greenhorn
Posts: 5
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I am getting a couple of errors with the following code:
try { for (String line = getLine(in); line != null; line = getLine(in)){line = line.substring(11);int location = line.indexOf("======"); if (location >= 0) line = line.substring(location + 6); public void processLine(String line2) { location = line.indexOf("lol"); if(location > 0); System.out.println("*laughs*");}
The errors are:
void is an invalid type for the variable processLine
Syntax error on token "(", ; expected
Syntax error on token ")", ; expected
Can anybody please help me try to fix this?
Thanks in advance!
Keith Lynn
Ranch Hand
Posts: 2412
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Are you declaring a method inside your try block?
E Jen
Greenhorn
Posts: 5
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Sorry, I see what I did. Thanks anyway.
Don't mess with me you fool! I'm cooking with gas! Here, read this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
HELP!
String to integer conversion
constructor to add to an array list
Arraylist
creating a new object in an ArrayList
More...