Object Oriented Concepts: Data abstraction, encapsulation, classes, constructors, destructors, classes and dynamic memory allocation, inheritance, polymorphism, generic classes, exception handling, file processing.
Java: Java applets, Java features, byte codes, internet classes, wrapper classes, multithreading support classes, Vector, Stack, interface Observer, StreamTokenizer, GUI classes, Java I/O classes, the Applet class, applet architecture, applet display methods, repainting.
Java static methods and inheritanceC++ constructors and exceptionsJava exceptions, interfaces and garbage collectioninheritance and polymorphismstatic members and constructorsexception handlingJava serialization and multithreadingtemplates / genericsstatic memberspolymorphism and OOP conceptsJava classes interfaces abstract classesexceptions and threadsC++ constructors and operator overloadingJava basics and polymorphism
class vs struct (C++)
Default member access and default inheritance: class → private, struct → public
Operators C++ cannot overload
:: . .* ?: sizeof typeid — and = () [] -> must be member functions
Copy constructor
X(const X&) — runs for X b = a; pass by value; return by value (often elided)
Construction order
virtual bases → bases (base-list order) → members (declaration order) → body; destruction exactly reverse
Rule of Three / Five
Destructor + copy constructor + copy assignment (+ move constructor + move assignment)
Virtual dispatch
One vtable per class, one vptr per object; virtual void f() = 0; makes the class abstract
C++ access after inheritance
public: pub→pub, prot→prot · protected: both→prot · private: both→priv · base private never accessible
Java primitive sizes
byte 1 · short 2 · int 4 · long 8 · float 4 · double 8 · char 2 bytes · boolean JVM-defined
JDK ⊃ JRE ⊃ JVM
JDK = JRE + tools (javac, java, javadoc, jar, jdb, javap); JRE = JVM + class libraries
Class file
Magic number 0xCAFEBABE; major version = Java release + 44 (Java 8 → 52, Java 17 → 61)
Integer cache
valueOf / autoboxing reuse −128…127 → == true inside, false outside; compare with equals()
String family
String immutable · StringBuffer mutable + synchronized · StringBuilder mutable, unsynchronized; capacity 16, grows ×2 + 2
Java exception hierarchy
Throwable → Error | Exception; RuntimeException and Error are unchecked; IOException, SQLException … are checked
finally
Always runs, even after return; only System.exit() or a dying JVM skips it; a return in finally overrides
Thread states
NEW → RUNNABLE ⇄ BLOCKED / WAITING / TIMED_WAITING → TERMINATED
Thread priorities
MIN_PRIORITY 1 · NORM_PRIORITY 5 (default) · MAX_PRIORITY 10
wait / notify
Object methods; caller must own the monitor (else IllegalMonitorStateException); wait releases the lock, sleep keeps it
Vector / Stack
Vector default capacity 10 and doubles; Stack.search() is 1-based from the top, −1 if absent
StreamTokenizer ttype
TT_EOF −1 · TT_EOL '\n' · TT_NUMBER −2 (nval, a double) · TT_WORD −3 (sval)
Default layouts
FlowLayout: Panel, Applet, JPanel · BorderLayout: Window, Frame, Dialog, JFrame content pane
Listener method counts
ActionListener 1 · KeyListener 3 · MouseListener 5 · MouseMotionListener 2 · WindowListener 7
Applet life cycle
init (once) → start → paint … stop → destroy (once); repaint() → update() → paint()