🌍 Android Development · flashcards
Android Development Java Programming Flashcards
50 question-and-answer cards covering Java Programming as it is examined in Android Development. 24 of them are printed below, taken from across the deck — no signup, no paywall on the preview.
24 sample cards from the Java Programming deck
Sampled from the end of the deck, so these are different cards from the ones shown on the syllabus page.
What is a constructor, and how does it differ from a method?
A constructor initializes a new object; it has the same name as the class and no return type. Unlike methods, it is invoked automatically via new and cannot be called directly on an existing object.
What is the difference between constructor overloading and the default constructor?
Constructor overloading provides multiple constructors with different parameter lists. The default (no-arg) constructor is supplied automatically by the compiler only if no constructor is explicitly defined.
What does the this keyword refer to in Java?
this is a reference to the current object instance. It is used to disambiguate fields from parameters, invoke other constructors (this()), or pass the current object as an argument.
Define inheritance and give the keyword used to implement it in Java.
Inheritance lets a subclass acquire fields and methods of a superclass, enabling code reuse and an "is-a" relationship. It is implemented with the extends keyword (implements for interfaces).
Does Java support multiple inheritance of classes? How is the limitation addressed?
Java does not support multiple inheritance of classes (to avoid the Diamond Problem). A class can implement multiple interfaces, achieving multiple inheritance of type.
What is the role of the super keyword?
super refers to the immediate parent class. It is used to call the parent's constructor (super(...)), access parent fields, or invoke parent methods that a subclass has overridden.
Define polymorphism and its two types in Java.
Polymorphism means "many forms" — one interface, many implementations. Compile-time (static) polymorphism via method overloading; runtime (dynamic) polymorphism via method overriding.
What is the difference between method overloading and method overriding?
Overloading: same method name, different parameter lists, within the same class (compile-time). Overriding: subclass provides a new implementation of an inherited method with the same signature (runtime).
What are the rules for a valid method override in Java?
Same name, same parameter list, same or covariant return type; access modifier not more restrictive; cannot override final/static/private methods; checked exceptions thrown cannot be broader. Use @Override to enforce.
Define abstraction and the two ways Java achieves it.
Abstraction hides implementation details and exposes only essential features. Java achieves it via abstract classes (0–100% abstraction) and interfaces (traditionally 100% abstraction).
What is an abstract class and can it be instantiated?
An abstract class (declared with abstract) can contain both abstract methods (no body) and concrete methods. It cannot be instantiated directly; it must be subclassed and its abstract methods implemented.
What is the difference between an abstract class and an interface (Java 8+)?
Abstract class: single inheritance, can have constructors, instance fields, and any access modifiers. Interface: multiple inheritance of type, fields are public static final, methods are public abstract by default (plus default/static/private methods since Java 8/9).
Define encapsulation and how it is implemented in Java.
Encapsulation bundles data (fields) and methods together and restricts direct access. It is implemented by declaring fields private and exposing controlled access through public getter and setter methods.
What is the difference between a checked and an unchecked exception?
Checked exceptions are checked at compile time and must be handled or declared (e.g. IOException). Unchecked exceptions (RuntimeException subclasses like NullPointerException) occur at runtime and are not enforced by the compiler.
Describe the try-catch-finally structure and the purpose of finally.
try holds code that may throw; catch handles specific exceptions; finally always executes (whether or not an exception occurred) and is used for cleanup like closing resources.
What is the difference between throw and throws?
throw is a statement used to actually raise an exception object (throw new IllegalArgumentException()). throws is a clause in a method signature declaring which checked exceptions the method may propagate.
What is the root of the Java exception hierarchy, and its two main branches?
The root is java.lang.Throwable. Its two branches are Error (serious, unrecoverable JVM problems) and Exception (application-level, recoverable conditions).
What is the Java Collections Framework and its core root interfaces?
A unified architecture of interfaces and classes for storing/manipulating groups of objects. Core interfaces: Collection (root), with subinterfaces List, Set, and Queue; plus Map (a separate hierarchy).
Compare ArrayList and LinkedList.
ArrayList uses a dynamic array: fast random access $O(1)$, slow mid-list insert/delete $O(n)$. LinkedList uses a doubly linked list: fast insert/delete at ends $O(1)$, slow random access $O(n)$.
What is the difference between a List, a Set, and a Map?
List: ordered, allows duplicates, indexed. Set: no duplicates, typically unordered. Map: stores key–value pairs with unique keys (not a Collection subtype).
What are Generics in Java and what problem do they solve?
Generics enable parameterized types (e.g. List<String>), providing compile-time type safety and eliminating explicit casts. They catch type errors at compile time rather than as runtime ClassCastExceptions.
What are the possible states in the Java thread life cycle?
New, Runnable, Running, Blocked/Waiting (including Timed Waiting), and Terminated (Dead).
What are the two ways to create a thread in Java, and which is preferred?
1) Extend the Thread class and override run(). 2) Implement the Runnable interface and pass it to a Thread. Implementing Runnable is preferred because it leaves the class free to extend another class.
What is the difference between byte streams and character streams in Java I/O, and name a base class of each?
Byte streams handle raw 8-bit binary data (base classes InputStream/OutputStream, e.g. FileInputStream). Character streams handle 16-bit Unicode text (base classes Reader/Writer, e.g. FileReader). Character streams handle encoding for text.
What this deck covers
The Java Programming deck follows the Android Development Java Programming syllabus — 5 chapters and 22 topics — so questions land on material that is genuinely examinable rather than trivia around it. That works out to roughly 10.0 cards per chapter.
Answers are written to be recallable, not just readable — averaging about 193 characters, which is long enough to carry the reasoning and short enough to say out loud.
A deck like this earns its keep on the second and third pass. Read the syllabus first so you know the shape of the subject, then use the cards to find the specific facts that have not stuck.
Java Programming flashcards FAQ
How many Java Programming flashcards are in this Android Development deck?
50 cards. This page previews 24 of them, sampled evenly across the deck so you can judge the difficulty before installing anything.
Are these Android Development flashcards free?
Yes. The preview here is free to read with no signup, and the full 50-card deck is free inside the Examius app.
What do the Java Programming cards cover?
They follow the Android Development Java Programming syllabus — 5 chapters and 22 topics — so the questions track what is actually examinable.
How should I use these flashcards?
Read the syllabus first so you know the shape of the subject, then drill the deck. Examius schedules each card with spaced repetition, so cards you keep missing come back sooner and ones you know drift further apart.