Wednesday, December 23, 2009

Hi, in java object oriented how is it possible to create a method for a class that will check if?

an instant variable has been set to a string, returning a boolean value true if the instant varabile does refrence a string. is it possible to create this method with or with out setter and getter methods.Hi, in java object oriented how is it possible to create a method for a class that will check if?
if 'var' is an instance of String then the code:





public boolean isString(Object astring) {


return (astring instanceof String);


}





will return true if the object is a string
  • highlight colors
  • eczema treatment
  • No comments:

    Post a Comment