MCQ Hive stays free thanks to ads. Please disable your ad blocker for this site so content and features keep working.
Data Types
Primitive Types & Sizes
Beginner
Q
In VB6 (classic Visual Basic), what are the sizes of Integer and Long?
AInteger is 16 bits; Long is 32 bits
BInteger is 8 bits; Long is 16 bits
CInteger is 32 bits; Long is 64 bits
DBoth are 32 bits
Correct Answer:
A. Integer is 16 bits; Long is 32 bits
Explanation:
In VB.NET, Integer is 32 bits and Long is 64 bits. This change between versions is a common source of confusion.
ALSO KNOW (related points):
• What is the minimum width that C++ guarantees for long long? → 64 bits
• In Java, how wide is the char type? → 16 bits (a UTF-16 code unit)
• In VB.NET, what is the value of CInt(True)? → -1
• When a variable is used without being declared and Option Explicit is off in VB6, what is its data type? → Variant