Results 1 to 3 of 3
- 05-04-2008, 03:13 PM #1
Member
- Join Date
- Mar 2008
- Posts
- 4
- Rep Power
- 0
Help with a very simple method for a very simple beginner.
Hi Everybody
How would I write a method / line of code to test wether or not an instance variable referenced a String? I'm trying to write a method that returns true if the variable references a String but I'm getting nowhere fast.
Many Thanks
Cakeman
- 05-04-2008, 05:01 PM #2
How did you assigned that instance variable? Is it an Object variable?
i am little bit doubt, can you show more info?freedom exists in the world of ideas
- 05-04-2008, 05:27 PM #3
Member
- Join Date
- Mar 2008
- Posts
- 4
- Rep Power
- 0
Hi
The instance variables will be set with a mutator method and not in the constructor so when new instances are first created, the instance variable is null. Just as I'm writing this I think I've sussed it. The method I need to write needs to return true if the instance variable references a string, false otherwise so, if the variable is null, it returns false. I'll try that first and post my results
Similar Threads
-
A Simple Web Server
By Java Tip in forum java.netReplies: 0Last Post: 04-07-2008, 08:04 PM -
Simple Method Question
By Froz3n777 in forum New To JavaReplies: 2Last Post: 02-13-2008, 02:39 AM -
Simple java
By abhiN in forum New To JavaReplies: 1Last Post: 01-16-2008, 10:13 AM -
simple GUI
By dim_ath in forum New To JavaReplies: 3Last Post: 01-07-2008, 03:00 PM -
simple code
By elizabeth in forum New To JavaReplies: 1Last Post: 08-07-2007, 06:49 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks