Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
3 views3 pages

Java Flash Cards CheatSheet

This document contains flash cards summarizing key concepts of Java Object-Oriented Programming (OOP) and Exception Handling. It covers topics such as inheritance, polymorphism, method overriding, abstract classes, interfaces, and exception types with relevant syntax and definitions. The flash cards serve as a quick reference for exam preparation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Java Flash Cards CheatSheet

This document contains flash cards summarizing key concepts of Java Object-Oriented Programming (OOP) and Exception Handling. It covers topics such as inheritance, polymorphism, method overriding, abstract classes, interfaces, and exception types with relevant syntax and definitions. The flash cards serve as a quick reference for exam preparation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

🧠 Java OOP & Exception Handling Flash Cards

Use these flash cards for fast recall before your exam. Each concept is on a separate card.

🔹 Inheritance
One class gets features from another.
✅ Syntax: class B extends A

🔹 super keyword
Calls parent constructor or method.
✅ Syntax: super(); or super.var

🔹 Constructor Execution
Parent constructor runs first.
✅ Order: Super → Sub

🔹 Types of Inheritance
Single: A → B
Multilevel: A → B → C
Hierarchical: A → B, A → C

🔹 Method Overriding
Same method name in child class.
✅ Runtime replacement of base method

🔹 Polymorphism
Same method behaves differently based on object type.
✅ A obj = new B(); obj.show();

🔹 Dynamic Method Dispatch


Method call decided at runtime.
✅ Based on actual object, not reference type.

🔹 Abstract Class
Has incomplete methods.
✅ Cannot be instantiated.
✅ Subclass must override abstract methods.

🔹 final Keyword
Locks class, method, or variable.
✅ final class → can't extend
✅ final method → can't override
🔹 Object Class
Base of all Java classes.
✅ Common methods: toString(), equals(), getClass()

🔹 Interface
All methods abstract by default.
✅ A class must implement all methods.

🔹 Default Method in Interface


Has a body in interface.
✅ Optional to override in class.
✅ Introduced in Java 8

🔹 Static Method in Interface


Belongs to interface.
✅ Called using InterfaceName.method()
✅ Not inherited

🔹 Private Method in Interface


Helper inside interface.
✅ Only used by default/static methods
✅ Introduced in Java 9

🔹 Packages
Folders to organize classes.
✅ Syntax: package mypack;

🔹 Importing Classes
Brings classes into your file.
✅ import java.util.Scanner;

🔹 Access Modifiers
public – everywhere
default – same package
protected – package + subclass
private – same class

🔹 Custom Exception
User-defined exception class.
✅ class MyException extends Exception
🔹 Chained Exception
One exception causes another.
✅ e1.initCause(e2);
✅ Track root cause

You might also like