Computer Science : Program Design

Study concepts, example questions & explanations for Computer Science

varsity tutors app store varsity tutors android store

Example Questions

2 Next →

Example Question #101 : Standard Data Structures

True or False.

 

The best data structure to represent a set of keys and values is an array. 

Possible Answers:

False

True

Correct answer:

False

Explanation:

Arrays can be two-dimensional. However, when trying to keep track of keys and values it can become complicated when using an array. HashMaps are the best way to represent data containing keys and values. 

Example Question #1 : Choosing Appropriate Data Structures

What is not a feature of the Java programming language?

Possible Answers:

Compile time error checking

Object Oriented Programming

Ability to write functions without making them class methods

primitive data types such as int, boolean and double

Garbage Collection

Correct answer:

Ability to write functions without making them class methods

Explanation:

In Java, the only way to write functions is to make them class methods. Java does have primitive types int, boolean double. There is compile time error checking. Java is an Object Oriented langauge and supports the OO paradigm. There is automatic garbage collection support, which helps manage memory for the user.

2 Next →
Learning Tools by Varsity Tutors