object-to-string Questions

4

Solved

Sometimes when I call a class's .ToString() method, it returns the fully qualified name of the class. But for some class's/struct's (like Int32) it returns a string correspoding to the object (valu...
Garnishment asked 9/4, 2012 at 15:43

3

Solved

I am working on exercise 41 in learnpythonthehardway and keep getting the error: Traceback (most recent call last): File ".\url.py", line 72, in <module> question, answer = convert(snipp...
Neveda asked 22/5, 2013 at 18:43

1

Solved

I wrote a timer class. And I want to override its toString method. But when I call the toString method, it still returns the super implementation. (fully qualified name of the class) Here is my ti...
Ciprian asked 14/8, 2015 at 12:25

2

Solved

Just out of curiosity. If I have the following Code public static string Format(dynamic exception) { switch (exception.GetType().ToString()) { case "test": return "Test2"; } return null; } ...

5

Solved

I don't understand why this works in java: If I have an Integer object in a object, example: Object myIntObj = new Integer(5); Now if i do: System.out.println(myIntObj); the output is: 5 I ...
Stefa asked 23/11, 2013 at 2:29

7

Solved

I am new to Java and I am learning the basics. I was studying the toString method and how to override it in my own classes. I am just wondering why has toString to be public? is it because it is de...
Dialectologist asked 17/3, 2013 at 23:19

1

Solved

In Haskell it is easy to make an algebraic type/discriminated union "displayable" as a string by simply adding deriving Show to the type definition. In F# I end up writing things like: type Pos =...
Copolymerize asked 19/2, 2010 at 10:29
1

© 2022 - 2024 — McMap. All rights reserved.