Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I WANT2 CHANGE METHOD, BUT IT DOESNT WORK, HELP~

 
Jose Cisse
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello everyone~~~im trying2 creat a program for inventory of bookshop

and i ve made several classes and they r interactive

just wonder: ...



this iz some method in my main bookshop class, and now i want2 change them2 "things like":


i tried it, but it doesnt work~~~iz there anyway2 do it???~~~if i done this, iz there affect2 other classes/the whole thing? OR no more interactive???

THX A LOT~~~~~~~~~~
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you say it "doesn't work," what exactly do you mean? Are there error messages at compilation? At runtime?

(If you're using Java 5.0, then you should look at the new enums feature.)
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Please avoid using capital letters (this is used for shouting)
2. Please avoid use bold characters to focus on something. Do not bold the whole message
3. Please do not use abbrevations like 'r' for 'are', '2' for 'to', or words like 'iz' for 'is'. It just makes it difficult to read for non native speakers.

Thank you
 
Jose Cisse
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Satou kurinosuke:
1. Please avoid using capital letters (this is used for shouting)
2. Please avoid use bold characters to focus on something. Do not bold the whole message
3. Please do not use abbrevations like 'r' for 'are', '2' for 'to', or words like 'iz' for 'is'. It just makes it difficult to read for non native speakers.

Thank you


really sorry~~~
 
Jose Cisse
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by marc weber:
When you say it "doesn't work," what exactly do you mean? Are there error messages at compilation? At runtime?

(If you're using Java 5.0, then you should look at the new enums feature.)


yes, there are error messages coming out
like for "private static final int DISPLAY B = 1;"

"; expected"
... ...
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your variable must be one word.
Try to change "DISPLAY B" by something like "DISPLAY_B"
Same for "DISPLAY R".
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jose Cisse:
...yes, there are error messages coming out
like for "private static final int DISPLAY B = 1;"

"; expected"
...

Oh, I see. You can't have a space in an identifier (variable name). You could use underscores, like DISPLAY_B and DISPLAY_R.
 
Jose Cisse
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OH~~~got it~~~THX a lot~~~


and...how do i deal with word "menu" ?
it always shows the error message:"cannot resovle symbol"

like: for" int option = getMenuInput();"

the error message coming out" cannot resovle symbol-method getMenuInput()"
???

MANY THX~~~
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It cannot find the method getMenuInput(). Are you sure there is such a method in your class ? If there is, check typos in its name.
 
Jose Cisse
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, i think so
i worte like


but method "displaymenu" cannot resolve sybmol as well...why???
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are calling methods, but do they actually exist ?
You should have those methods somewhere:
[/code]
void displaymenu() {
...
}
int getMenuInput() {
...
}
void doOption(int) {
...
}
[/code]
 
Jose Cisse
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Satou kurinosuke:
You are calling methods, but do they actually exist ?
You should have those methods somewhere:
[/code]
void displaymenu() {
...
}
int getMenuInput() {
...
}
void doOption(int) {
...
}
[/code]


sorry, can you say abit more specific?
if they dont exist, how do i fix them? OR example please~~~

MANY THX~~~
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


1. You are calling displaymenu(). Where is this method ?
2. You are calling getMenuInput(). Where is this method ?
3. You are calling doOption(). Where is this method ?
 
Jose Cisse
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, i understand it...
but how do you create those method (in order to make the whole thing work)???

MANY THX~~~
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this some homework ? I don't want to throw out the solution if you were asked to do this.
But think about it. There were already the necessary methods in the first version of your program. The second version contains the same logic, with different method names.
 
Jose Cisse
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Satou kurinosuke:
Is this some homework ? I don't want to throw out the solution if you were asked to do this.
But think about it. There were already the necessary methods in the first version of your program. The second version contains the same logic, with different method names.


ok~~~thx a lot~~~
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic