All AP Computer Science A Resources
Example Questions
Example Question #2 : Arrays
Which of these instantiate a matrix called matrx with 5 columns and 4 rows that takes in integers?
Possible Answers:
int [] [] matrx = new int [] [4];
int [] [] matrx = new int [5] [4];
int [] [] matrx = new int [5] [];
int [] [] matrx = new int [] [5];
int [] [] matrx = new int [4] [5];
Correct answer:
int [] [] matrx = new int [] [4];
Explanation:
You create a matrix also known as a 2 dimensional array the same way you'd instantiate a normal array except the first array space remains blank and you'd insert the number for the amount of rows. Due to the fact that you want 5 columns and 4 rows, you'd only input the 4 into the second array.
All AP Computer Science A Resources
Popular Subjects
GRE Tutors in Chicago, Calculus Tutors in Miami, GRE Tutors in San Diego, LSAT Tutors in Boston, Statistics Tutors in Miami, SSAT Tutors in Seattle, Chemistry Tutors in Chicago, GMAT Tutors in Seattle, English Tutors in Seattle, Spanish Tutors in Denver
Popular Courses & Classes
Spanish Courses & Classes in New York City, GRE Courses & Classes in Los Angeles, SSAT Courses & Classes in Houston, ACT Courses & Classes in Philadelphia, MCAT Courses & Classes in San Diego, GMAT Courses & Classes in Phoenix, Spanish Courses & Classes in Philadelphia, Spanish Courses & Classes in Chicago, SSAT Courses & Classes in Denver, LSAT Courses & Classes in Miami
Popular Test Prep
MCAT Test Prep in New York City, MCAT Test Prep in Boston, SAT Test Prep in Phoenix, GRE Test Prep in Chicago, GRE Test Prep in New York City, ACT Test Prep in Philadelphia, SAT Test Prep in New York City, GMAT Test Prep in Chicago, ACT Test Prep in Chicago, ISEE Test Prep in Denver