In Java, which keyword is used to create a subclass that inherits from a superclass?
MCQ + FRQ
AP Computer Science A
Java, classes, inheritance, and 4 code-writing FRQs.
8practice MCQs
1FRQ prompts
1–5scaled scoring
Freeno paywall
What's in CSA
Every unit is mapped to the official Course and Exam Description.
U1Primitive Types
U2Using Objects
U3Boolean Expressions
U4Iteration
U5Writing Classes
U6Array & ArrayList
U72D Array
U8Inheritance
U9Recursion
Try a few sample questions
Real CSA format. Filter by difficulty or skill, then tap an answer to reveal the explanation.
Difficulty
Skill
What is the output of the following Java code? int[] arr = {3, 1, 4, 1, 5}; System.out.println(arr[2] + arr[4]);
What is the time complexity of binary search on a sorted array of n elements?
What does the following recursive method return when called with n=4? public static int mystery(int n) { if (n == 0) return 1; return n * mystery(n-1); }
Sample FRQ · AI graded
FRQ prompt
Free Response Question: Write a Java class called NumberAnalyzer with the following: (a) A constructor that takes an int[] array and stores it as an instance variable. (b) A method called getMax() that returns the maximum value in the array. (c) A method called countAboveAverage() that returns the count of elements strictly greater than the mean of all elements.Practice full FRQs
Ready to score a 5?
Adaptive CSA drills, instant explanations, and FRQ feedback graded on the official rubric — all free.