Top "Primitive" questions

A primitive type is a data type provided by a programming language as a basic building block.

object vs. primitive

Recently had an interviewer ask to define the difference between objects and primitives. Seemed like an odd question considering that …

javascript oop object primitive
Are primitive datatypes thread-safe in Java

Are the primitive data types like int & short thread-safe in Java? I have executed the following code and couldn't …

java thread-safety primitive
What is the third boolean state in java?

While I know that by definition a boolean consists of only two states, true or false. I was wondering what …

java boolean primitive
Are Java primitives immutable?

If a method has a local variable i: int i = 10; and then I assign a new value: i = 11; Will this …

java primitive
How do I test if a primitive in Objective-C is nil?

I'm doing a check in an iPhone application - int var; if (var != nil) It works, but in X-Code this …

iphone objective-c primitive
Is int an object in Java?

More precisely, is int a part of the Integer class (a stripped down version or something) or is it something …

java inheritance primitive
java: boolean instanceOf Boolean?

I'm a bit confused: I have a function, that takes an Object as argument. But the compiler does not complain …

java casting boolean primitive autoboxing
How does double to int cast work in Java

I am new to Java, and wondering how does double to int cast work ? I understand that it's simple for …

java casting primitive mantissa
Bitconverter for Java

Following the advice provided in the question https://stackoverflow.com/questions/1738244/what-is-the-java-equivalent-of-net-bitconverter I have begun implementing my own bitconverter for …

c# java bytearray primitive
Java Vector or ArrayList for Primitives

Is there an expandable array class in the Java API equivalent to the Vector or ArrayList class that can be …

java vector arraylist primitive-types primitive