I have read about methods until I'm blue in the face..
yet every time I try to write my own method from scratch I get "illegal
start of expression" error no matter how I declare it..
public String myMehtod() {
private String myMethod() {
String myMethod () { // on this one says I need ';' at
// end of this line....????
this is a method that simply processes a string... (I have 'return
<StringVar>' at the end..
this is very frustrating.. would appreciate some help, pls.. thank you..
Frances
> I have read about methods until I'm blue in the face..
>
[quoted text clipped - 10 lines]
>
> this is very frustrating.. would appreciate some help, pls.. thank you..
class MyClass{
public String myMethod(){
String answer = "Hello World";
return answer;
}
}
Is this wat you mean?
Maybe you can start with a java tutorial like the ones on
http://java.sun.com/docs/books/tutorial/index.html
Just follow the creation of a program step by step...
T.
Frances - 24 Aug 2005 16:52 GMT
>>I have read about methods until I'm blue in the face..
>>
[quoted text clipped - 19 lines]
>
> Is this wat you mean?
yes, this is what I mean.. thank you.. I HAVE read up on methods, among
others (MANY others...)
http://scv.bu.edu/Doc/Java/tutorial/java/javaOO/methods.html
this is for an applet.. I had this method inside init() method, I took
it out of there, now it's just inside applet class... I declare class,
I declare vars, I declare the method.. this is a method that will do
nothing more than process an e-mail address to convert it to something
else.. I need to pass a string to the method.. but string I need to pass
is a var, not a literal.. so can I do..
public String myMethod(String sUid){
then in method call pass var that will be drawn from a getParameter()
method (pulling param from html that calls applet..):
sUid = getParameter("uid");
this var I need to pass to method and process...
thank you very much..
> I have read about methods until I'm blue in the face..
>
[quoted text clipped - 12 lines]
>
> Frances
Is the method inside a class?
public class Foo
{
public String myMethod()
{
return "Foo";
}
}

Signature
monique
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html