Facebook Pixel
Data Types: Primitives vs Non-Primitives

Is a String a primitive data type?

The answer

In most languages (like Java and C++), Strings are non-primitive reference types because they are arrays of characters. In JS, they behave like primitives.

More FAQs in Data Types: Primitives vs Non-Primitives

A primitive data type is a basic, built-in type that holds a single, simple value, like an integer, character, or boolean.

An integer stores whole numbers without a fractional component. A float (floating-point) stores numbers with decimal points.

You are usually copying the memory reference, not the actual data. Both variables will point to the exact same object in memory.

Still have questions?

Browse all our FAQs or reach out to our support team

Want to upskill yourself?

Your learning library

Small steps. Big possibilities.

Find your next course. Build something great.

Our courses are taking a Coffee break, but your curiosity shouldn't. Stay engaged with namastedev linkedin, youtube, discord and other resources while you wait.

0

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.

Success

Please Login.