1/28
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Comment (Java)
A line that describes code, written as // This is a comment for single-line or /* This is a multi-line comment */ for multi-line.
Comment (Python)
A line that describes code, written as # This is a comment for single-line or ''' This is a multi-line comment ''' for multi-line.
Pass by Value
In Java, a copy of the value is passed to the function, so changes do not affect the original variable.
Pass by Reference
In Python, when passing mutable objects, the reference to the actual memory location is passed, allowing modifications to affect the original.
Recursion
Occurs when a function calls itself, useful in solving problems that can be divided into smaller sub-problems.
Factorial (Java Example)
A method that calculates the factorial of a number using recursion.
Factorial (Python Example)
A function that calculates the factorial of a number using recursion.
Compiler (Java)
Translates the entire source code into machine code before execution, making execution faster.
Interpreter (Python)
Translates and executes code line-by-line, which allows easier debugging but is typically slower.
== in Java
Compares memory addresses, checking if two references point to the same object.
.equals() in Java
Compares actual values stored in the objects, determining if they are logically equivalent.
== in Python
Compares values to check if two objects hold the same data.
is in Python
Compares memory addresses, checking if two references point to the same object.
Object-Oriented Programming (OOP)
A programming paradigm that organizes code into objects containing data (attributes) and methods (behaviors).
Encapsulation
Hides the internal state of an object and requires controlled access through methods.
Inheritance
Allows a class to inherit properties and methods from another class.
Polymorphism
Enables methods to be implemented in different forms based on context.
Abstraction
Hides complex implementation details and exposes only the relevant functionalities.
Class (Definition)
A blueprint to create objects, defining properties and methods.
Object (Definition)
An instance of a class that possesses state and behavior.
Constructor (Java)
A special method to initialize an object when it is created.
Constructor (Python)
A special method (init) used to initialize an object when it is created.
Method Overriding
Allows a subclass to provide a specific implementation for a method defined in its parent class.
Abstract Class
A class that cannot be instantiated and may contain abstract methods that must be implemented by subclasses.
Interface
Defines methods that a class must implement; it contains no implementation.
Getters
Methods that retrieve values from an object's attributes.
Setters
Methods that modify values of an object's attributes, maintaining encapsulation.
Multiple Inheritance (Java)
Java does not support multiple inheritance directly to avoid ambiguity.
Multiple Inheritance (Python)
Python supports multiple inheritance, allowing a class to inherit from multiple classes.