Re: weird runtime error



On Mar 27, 8:22 pm, "Oliver Wong" <o...@xxxxxxxxxxxxxx> wrote:

It's not an error. You are probably providing an instance of Region to
System.out.print() or System.out.println(). The implementation of
System.out.println() is to invoke the .toString() method on any objects
passed in.

The conceptually simplest fix would be to not pass an instance of
Region to System.out.println() at all, but rather to query the Region
objects for the information you wish to print out (e.g. the contents of a
specific cell), and print that out instead.

Another solution would be to modify the Region class so that it
overrides the toString() method.

- Oliver

Thakns a lot for the replies! :) I think I get it.

.



Relevant Pages

  • Re: Making static class ToString() not possible, why?
    ... I don't want to inherit anything. ... invoked when you append "it" to a string, but with a static class there ... ToString() to easily print out all of its data. ... how can object.ToString be invoke on a static class? ...
    (microsoft.public.dotnet.languages.csharp)
  • Get an objects value as a string
    ... I am looking for a generic way to see if an object supports the ToString ... then invoke that method to return the results of that generic ... In this exception class I would like to be able to provide a ToString method ... Blog: http://spaces.msn.com/members/rcassick/ ...
    (microsoft.public.dotnet.languages.vb)