All AP Computer Science A Resources
Example Questions
Example Question #3 : 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 [] [5];
int [] [] matrx = new int [5] [4];
int [] [] matrx = new int [5] [];
int [] [] matrx = new int [4] [5];
int [] [] matrx = new int [] [4];
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
LSAT Tutors in San Diego, ISEE Tutors in Seattle, ACT Tutors in Seattle, SSAT Tutors in Houston, ACT Tutors in Washington DC, GRE Tutors in Atlanta, GMAT Tutors in Philadelphia, Physics Tutors in Philadelphia, Statistics Tutors in San Diego, Algebra Tutors in Atlanta
Popular Courses & Classes
ACT Courses & Classes in Philadelphia, ACT Courses & Classes in San Diego, ACT Courses & Classes in Seattle, ISEE Courses & Classes in San Diego, ISEE Courses & Classes in Chicago, MCAT Courses & Classes in New York City, LSAT Courses & Classes in Los Angeles, ACT Courses & Classes in Boston, GRE Courses & Classes in Phoenix, ISEE Courses & Classes in Denver
Popular Test Prep
ISEE Test Prep in San Diego, GRE Test Prep in Phoenix, LSAT Test Prep in Dallas Fort Worth, SAT Test Prep in Washington DC, ACT Test Prep in San Francisco-Bay Area, ACT Test Prep in Houston, SAT Test Prep in Dallas Fort Worth, GMAT Test Prep in New York City, MCAT Test Prep in Dallas Fort Worth, GRE Test Prep in Philadelphia