This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Murach's Java Programming and have Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Java Programming this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

instanceOf in J2ME  RSS feed

 
Reggie McDougal
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I tell in J2me type of object ie. passing and object into a method
that I need to determine the type before evaluating
 
Ramender Mall
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the question is about instanceOf...
then you use it exactly as you use it in other java programs..

e.g


Hope it helps



- Ramy..
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But also, like J2SE, you really want to try to avoid using instanceof at all costs.

What is the reason why you need to use instanceof? Maybe we can help you find a better solution.

Mark
 
We can walk to school together. And we can both read this tiny ad:
Thoughts on deprecation in Java
https://coderanch.com/t/683016/java/Deprecation-Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!