Multiple choice technology programming languages

C++ requires that you re-declare static data members outside the class. This is not required in Java.

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In C++, static data members must be declared inside the class but defined outside the class (in a .cpp file) to allocate storage. Java combines declaration and definition in one step inside the class. This is a key difference between the two languages' handling of static members.