A fast reference to common OOP concepts, commands, and resources in this repository.
# Basic compilation
g++ filename.cpp -o output
# With C++17 standard and warnings
g++ -std=c++17 -Wall -Wextra filename.cpp -o output
# Multiple files
g++ file1.cpp file2.cpp -o output
# Run the program
./output # Linux/Mac
output.exe # Windows# Compile
javac ClassName.java
# Run
java ClassName
# Compile with warnings
javac -Xlint:all ClassName.java-
Encapsulation 🔒
- Bundling data and methods together
- Using access modifiers (private, public, protected)
- See: C++ Lecture 02, Java Chapter 9
-
Inheritance 🌳
- Creating new classes from existing ones
- Code reusability through parent-child relationships
- See: C++ Lecture 07, Java Chapter 11
-
Polymorphism 🎭
- Same interface, different implementations
- Method overloading and overriding
- See: C++ Lecture 05-06, 10, Java Chapter 11
-
Abstraction 🎨
- Hiding complex implementation details
- Using abstract classes and interfaces
- See: C++ Lecture 10, Java Chapter 13
class MyClass {
private:
int data;
public:
MyClass(int d) : data(d) {} // Constructor
~MyClass() {} // Destructor
void display() { cout << data; }
};
MyClass obj(10); // Object creationint* ptr = new int(10); // Pointer
int& ref = *ptr; // Reference
delete ptr; // Memory cleanupclass Base {
// Base class
};
class Derived : public Base {
// Derived class
};class Base {
public:
virtual void display() {
// Can be overridden
}
};public class MyClass {
private int data;
public MyClass(int d) { // Constructor
this.data = d;
}
public void display() {
System.out.println(data);
}
}
MyClass obj = new MyClass(10); // Object creationpublic class Base {
// Base class
}
public class Derived extends Base {
// Derived class
}public interface MyInterface {
void method(); // Abstract method
}
public class MyClass implements MyInterface {
public void method() {
// Implementation
}
}try {
// Code that may throw exception
} catch (Exception e) {
// Handle exception
} finally {
// Always executes
}| Topic | C++ Location | Java Location |
|---|---|---|
| Basics | Lecture 01 | Chapter 1-2 |
| Classes | Lecture 02-03 | Chapter 9 |
| Memory Management | Lecture 04 | N/A (Automatic) |
| Overloading | Lecture 05-06 | Chapter 6, 11 |
| Inheritance | Lecture 07 | Chapter 11 |
| I/O | Lecture 08-09 | Chapter 12 |
| Polymorphism | Lecture 10 | Chapter 11 |
| Templates/Generics | Lecture 11, 14 | N/A (Built-in) |
| Exceptions | Lecture 11 | Chapter 12 |
| Abstract Classes | Lecture 10 | Chapter 13 |
- Beginner: Lectures 01-02, Chapters 1-4
- Intermediate: Lectures 03-07, Chapters 5-9
- Advanced: Lectures 08-14, Chapters 10-13
Problem: undefined reference to...
# Solution: Link all required files
g++ main.cpp class.cpp -o outputProblem: Memory leaks
// Solution: Always delete allocated memory
int* ptr = new int(10);
delete ptr; // Don't forget!Problem: Segmentation fault
// Solution: Check for null pointers
if (ptr != nullptr) {
// Use pointer
}Problem: Could not find or load main class
# Solution: Ensure class name matches filename
javac ClassName.java
java ClassName # Not ClassName.javaProblem: NullPointerException
// Solution: Check for null
if (obj != null) {
obj.method();
}- 📖 Getting Started - Setup and installation
- 🗺️ Content Index - All materials catalog
- 🤝 Contributing - How to contribute
- 💬 Support - Getting help
- 🔒 Security - Security policy
- cppreference.com - Complete C++ reference
- cplusplus.com - Tutorials and reference
- LearnCpp.com - Free tutorials
- Oracle Java Docs - Official documentation
- Java Tutorials - Official tutorials
- W3Schools Java - Quick reference
- GeeksforGeeks - Concepts and examples
- Design Patterns - Common patterns
- Start Sequential: Begin with Lecture 1/Chapter 1
- Practice Daily: Code along with examples
- Understand Don't Memorize: Focus on concepts
- Debug Often: Learn from errors
- Use Documentation: Check guides when stuck
- Ask Questions: Use issue templates
- Review Regularly: Revisit earlier topics
- Find specific topics:
keyword in:path - Search code:
function_name language:cpp - Find files:
filename:*.cpp
- Use Content Index for organized navigation
- Check folder README files for detailed info
- Use Ctrl+F to search within files
- C++ Programs: 139+
- Java Programs: 17+
- Documentation Files: 80+
- Lectures/Chapters: 27
- Topics Covered: 50+
| Need | Link |
|---|---|
| Setup Help | Getting Started |
| Find Topic | Content Index |
| Report Bug | Bug Report |
| Ask Question | Question Template |
| Suggest Feature | Feature Request |
| Get Support | Support Guide |
| Contribute | Contributing Guide |
- Install compiler/JDK (guide)
- Clone repository
- Navigate to desired topic
- Compile and run examples
- Read topic's README.md
- Review code examples
- Understand concepts
- Try practice problems
- Test your understanding
- Check relevant documentation
- Search existing issues
- Ask in discussions
- Create an issue if needed
Remember:
- ✅ Make mistakes - they're learning opportunities
- ✅ Practice regularly - consistency is key
- ✅ Ask questions - no question is too small
- ✅ Help others - teaching reinforces learning
- ✅ Have fun - enjoy the journey!
Happy Coding! 🚀
For detailed information, always refer to the complete documentation in the repository.