• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can I change a method signature?

 
Valeri Mikhailov
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I change the signature of lock(int recordNumber) to lock(String flightNumber)?
 
mao lao
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
according many post here,
yes, u can
 
Jawad Kakar
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you can, but if you want to pass a String instead of a int, before calling the lock(int), change the String to int and then call lock(int).
Jawad
[ December 01, 2002: Message edited by: Jawad Kakar ]
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Valeri Mikhailov:
Can I change the signature of lock(int recordNumber) to lock(String flightNumber)?
You can, but would it be a good idea? It reads as if you're turning a perfectly generic, fully reusable class into something application-specific. Surely that's the wrong direction altogether?
- Peter
 
Valeri Mikhailov
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks gays,I will not.
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shhhhht! I haven't come out here yet
- Peter
 
mao lao
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
gays?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic