AP Computer Science A : Program Design

Study concepts, example questions & explanations for AP Computer Science A

varsity tutors app store varsity tutors android store

Example Questions

2 Next →

Example Question #1 : Arrays

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 #6 : Choosing Appropriate Data Structures

What is not a feature of the Java programming language?

Possible Answers:

Object Oriented Programming

Ability to write functions without making them class methods

Garbage Collection

Compile time error checking

primitive data types such as int, boolean and double

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