primitive

Primitive thickness - DX10

Hello, i recently stepped into primitive rendering in directX10. I need that because i want to convert my ingame chat from directx9 to 10 due my huge performance lag being forced by the games weak dx9 support. The lines are being rendered fine on the positions i want. My actual problem is that they doesnt appear as thin as in directX9 ...

java: boolean instanceOf Boolean ?

Hello everyone. I'm a bit confused: I have a function, that takes an Object as argument. But the compiler does not complain if I just pass a primitive and even recognizes a boolean primitive as Boolean Object. Why is that so? public String test(Object value) { if (! (value instanceof Boolean) ) return "invalid"; if (((Boolean) v...

java: Integer equals vs. ==

As of java 1.5, you can pretty much interchange Integer with int in many situations. However, I found a potential defect in my code that surprised me a bit. The following code: Integer cdiCt = ...; Integer cdsCt = ...; ... if (cdiCt != null && cdsCt != null && cdiCt != cdsCt) mismatch = true; appeared to be incorrectly setting m...

storing Integer objects with primitive int in HashMpa

Hi, HashMap uses objects as a key. If you use int primitive as key, it uses auto boxing and create integer objects for key. is there any hashmap implementation uses primitive types as key. I dont want autoboxing. becuase hascode of integer is also value of integer. I am trying to create integer object pool. regards Trustin ...

What is the difference between String.Format and string.Format (and other static members of primitive data types)?

As far as I can tell, any static member of a class like String or Int32 can also be accessed from the related primitive data type. So, String.Format is the same as string.Format, and Int32.MaxValue is the same as int.MaxValue. Is there a difference between these two forms? Is one preferred to the other? Even if they are identical, is on...

How to concisely create a String that begins with a primitive value without using an empty double-quote?

To get a newString value of "99 bottles": int x = 99; String fruit = " bottles"; To form a new String I do this: String newString = "" + x + fruit; since this is not allowed: String newString = x + fruit; But there's something about using the double quotes here that doesn't seem right. Is there a better way to do this (without ...