Projects in Awesome Lists tagged with abstract-classes
A curated list of projects in awesome lists tagged with abstract-classes .
https://github.com/saberglow/java_programming_principles_of_software_design
My solutions to assignments/problems for the course (Java Programming: Principles of Software Design) offered by Duke University at Coursera.
abstract-classes android-location arraylists comparable comparator interfaces markov-model
Last synced: 26 Oct 2025
https://github.com/madhurimarawat/object-oriented-programming-with-c-plus-plus
This repository contains programs in the C++ programming language related to Object Oriented programming.
abstract-classes array-manipulations arrays-and-strings constructor cpp encapsulation exception-handlers exception-handling file-handling-in-cpp inheritence object-oriented-programming oops-in-cpp overloading pointer-to-function pointers-and-references polymorphism static string-manipulation templates virtual-functions
Last synced: 08 Jan 2026
https://github.com/mgobeaalcoba/poo-abstract-class-practice
Practica POO: abstract class, anonimous class, Inheritance and Polymorphism
abstract-classes abstraction java poo
Last synced: 22 May 2026
https://github.com/tebogoyungmercykay/towers_of_hanoi_puzzle_solver
Towers of Hanoi is a popular puzzel game that consists out of two main components: three towers and n number of disks. The goal of this puzzel game is to move the tower of disks from one tower to another tower with only moving a single disk at a time.
abstract-classes classes exceptions inheritance iterative-approach objects oop-in-cpp pointers puzzle-game recursion stl stl-stacks template-classes tower-of-hanoi uml
Last synced: 14 Jul 2025
https://github.com/pdalbem/poo
Repositório da disciplina Programação Orientada a Objetos
abstract-classes abstract-method abstraction encapsulation functional-interfaces inheritance interfaces java jdbc-database method-overloading method-overriding object-oriented-programming polymorphism
Last synced: 02 Jan 2026
https://github.com/ejarvinen/42cpp_modules
Collection of 10 modules of C++ basics
abstract-classes casting-to-types dynamic-memory-allocation inheritance iterator polymorphism stl-algorithms stl-containers templates
Last synced: 26 Jun 2025
https://github.com/luisfernandovillalon/cs231-introdatastructures
A repository to showcase my coursework for my Introduction to Data Structures college course.
abstract-classes array data-structures exception-handling generics interfaces java javafx linkedlist queue recursion stack text-io
Last synced: 11 Mar 2025
https://github.com/stuartdaniells/wordgame_recursion
Using recursion, guess the number of repetitive letters in a word or words
abstract-classes inheritance java overloading overriding polymorphic-relationships recursion
Last synced: 29 Jul 2025
https://github.com/gxsilva/42sp_cpp
This repository contains all C++ exercises from 42 SP, including bonus parts. It also includes personal notes and study materials to support the learning process.
abstract-classes cpp cpp98 inheritance oop polymorphism
Last synced: 14 Aug 2025
https://github.com/mohamed-taha-essa/hackerrankproblems
Hacker rank solution using python programming language with simple code.
abstract-classes collections-python dictionaries-in-python hackerrank-solutions inheritance-examples itertools listcomprehensions nestedlist oops-in-python ordereddict problem-solving python python3 recursion-basics set
Last synced: 12 Aug 2025
https://github.com/guicdas/cpp_42
C++ programming, modules from CPP00 to CPP09 from 42 common core.
abstract-classes algorithms-and-data-structures casts class-creator containers cpp cpp98 cppbasics exception-handling inheritance interfaces memory-allocation overloaded-operators overloading templates
Last synced: 16 Aug 2025
https://github.com/manuchaitanya17/object-oriented-programming
A Course for learning Object-Oriented Programming in Java.
abstract-classes abstraction constructor encapsulation generics inheritance interfaces introduction-to-oops introduction-to-programming-paradigms objectandclass packages polymorphism wrapper-class
Last synced: 03 Apr 2025
https://github.com/bodnya29179/typescript-advanced
🏆 Advanced TypeScript examples covering types, method overriding, namespaces, module augmentations, global declarations, and best practices.
abstract-classes advanced-typescript declare guards interfaces namespace override typescript
Last synced: 16 Jun 2025
https://github.com/profcalabrese/4bt
ProgettoPokemon
abstract-classes arraylist heredity java
Last synced: 24 Mar 2025
https://github.com/guicdas/cpp04_42
CPP04 module: Abstract classes and interfaces.
abstract-classes cpp cpp98 interfaces
Last synced: 11 Jun 2025
https://github.com/0xromjobert/cpp04
A 42 exercise on subtype polymorphism, abstract classes and interfaces in C++
abstract-classes cpp cpp98 interfaces subtype-polymorphism
Last synced: 01 Apr 2025
https://github.com/bell-kevin/inventorysales
inventory Sales. The ideas of abstract classes and interfaces can be difficult. Both concepts are used to enforce behavior in a project. That is, any class that inherits from an abstract class must implement whatever was abstract in that class. Any class that implements an interface has access to the variables declared there, and if there are any methods, they must be implemented in that class. You may write a class or interface for a specific project, so you can make sure to include whatever methods that need to be implemented. If your class or interface is used in another project, how do you ensure that the other project will have the appropriate methods? Abstract methods and methods in an interface require some code before the compiler can execute, thus enforcing certain behaviors. To see this in action, this simple project about inventory and sales of items in inventory will have an abstract method, which makes the class abstract, and an interface with a method. There are 2 types of inventory, food and non-food (other items), and each is taxed at a different rate. Start with the interface, which specifies sales tax. This tax interface has 2 variables for tax rates in it -- 4% for food, 10% for other items. These can be declared as constants in the tax interface, and when the interface is implemented in the inventory classes, those values are available. What does this provide? You might consider these to be global values, declared in one place and used in many. If the tax rate changes, you only have to edit the value for those variables in the interface, and all methods will use that new rate. In addition, this tax interface will have a method to make sure that tax is calculated for each sale. This is an example of enforcing behavior. If the method to calculate tax is declare in an interface, it is the header only, no content or code -- that is left up to the classes and methods that use this interface. Because the method is declared in the interface, it must also be declared in the classes that implement the interface, which enforces the behavior that sales tax must be calculated. It becomes much harder to "forget" to calculate the tax if the method to calculate it is required this way. Create an interface in your project. Click on File, then New File, select Java Interface, which is just below Java Class. Name it Tax -- use an initial uppercase letter, as you do with classes. Declare 2 constants, one for food tax at 4% or .04, one for non-food or item tax at 10% or .10. Write the header for a method to calculate the tax, which needs a double as a parameter and returns a double. End this header with a semicolon -- this declares the method but doesn't flesh it out, which must be done in classes that implement this interface before the project can compile. Create an Inventory class which is the super class for the 2 types of inventory. This class has instance variables for the inventory ID (integer), name (string), quantity on hand (integer), and unit cost (double). The constructor for the class includes all 4 instance variables as parameters. Write a method to display the item, as seen in the images below, making sure to display money values correctly. There will be 2 other classes, sub classes to the Inventory class. One is Food, one is OtherItem. The only difference in these classes is they use different tax rates. You might question why there are 3 classes to describe inventory when the only difference is that tax rate. You could have a field or fields in Inventory that specify if the item is Food or Other, which would work in this very simple example. But in more realistic projects, food items would have a lot of instance variables that don't describe non-food items, and non-food items would have a lot of instance variables not appropriate for food items. To focus on abstract methods and interfaces, we are leaving out all of those specific variables and including only the 4 that are common to both sub classes. Create a Food class that inherits from the Inventory class. It has no additional instance variables. Its constructor needs 4 parameters, and all of them will be sent to the super class constructor. Create a class for OtherItem that inherits from the Inventory class. It looks exactly the same as the Food class so far. There are 3 classes in this project. Where should you implement the Tax interface? If only one of the sub classes needed the variables and methods of this interface, then that sub class would implement it. In this case, both the Food class and the OtherItem class could implement it. If the super class, Inventory, implements the interface, then both sub classes will inherit that implementation. It is another way to enforce behavior to implement the interface at the super class level, which will require code in the sub classes for the interface method(s). So implement the Tax interface in the Inventory class. Look at the Food and OtherItem classes -- they won't compile at this point. The Tax interface has a method header in it to calculate the tax, which must be completed -- its code must be written to satisfy the requirements of interfaces. You could write code for that method in the Inventory class -- but the sub classes need to use different tax rates. So the best place to implement the method is in each sub class. Write a method to calculate the tax in the Food class and in the OtherItem class. The specifications of the method are in the interface -- it has a name, it needs a double for a parameter, and it returns a double. The code you write in the sub classes can do whatever work is needed for each class, as long as it matches that header in the interface. In the sub classes, add a method for calculating the tax, which returns the price of a purchase multiplied by the appropriate tax. This method returns the amount of tax, doesn't add to a total cost or change inventory levels, just calculate tax for that kind of inventory object. Note that it is possible to have multiple interfaces in a project. If there were two interfaces, like FedTax and StateTax, you could implement both in a class with "implements FedTax, StateTax" -- put a comma between them. Go back to the Inventory class. You could write a method to calculate the cost of an inventory object. That method could be inherited in sub classes. But you may not be able to say that the calculation is exactly the same in every sub class. The way to require a method in sub classes is to declare its header in the parent class and make it abstract. Just like declaring a method in an interface, you write the header line of the method and end it with a semicolon -- no code in the body of this method. Add the word "abstract", usually after "public" and before the return type. If this method that must be written in sub classes is named "calcCost", the header might be: public abstract double calcCost(int qty); Because this method is abstract, the entire class must be marked as abstract. Add that word in the class header, like this: public abstract class Inventory implements Tax { Now there is a method named calcCost in the Inventory class that is abstract. That means the sub classes, Food and OtherItem, must have methods that provide the code for calcCost. Go to each sub class, which is not able to compile without handling the abstract method. Add the method, which must have the same header but without the word "abstract". In this simple project, again, these methods are identical in the two sub classes, but in reality, they could be very different. In this project, check if the quantity of the purchase is less than or equal to the quantity on hand. If the sale quantity is valid, determine the price by multiplying the quantity of the purchase and the unit cost. Calculate the tax by calling the calcTax method that was required by the interface. Add that tax to the price. Subtract the quantity of the sale from the quantity on hand. Return the price. If the quantity of the purchase is invalid, if it is greater than the quantity on hand, print out an error message and return a price of zero. At this point, you should have: an interface for the tax rates, which includes a method to calculate tax a class for inventory, which has 4 instance variables, a 4-parameter constructor, a display method, and an abstract method for calculating the cost of a sale, which requires that the whole class is abstract, and it implements the Tax interface a sub class for Food objects that inherits from the Inventory class, which has code for the method to calculate tax (required from the interface) and for the method to calculate the cost of a sale (required to complete the abstract method in the Inventory class) a sub class for OtherItem objects that is basically identical to the Food class, except it uses a different tax rate in the method to calculate the tax Now work on the main method. Create an Array List of Inventory objects. Add anonymous Food objects and OtherItem objects to it, 2 of each type. Using a For-Each loop, print out the item, ask the user how many they want to purchase, get the price for that sale, and print out the item to see that the quantity on hand has changed. Here is the sample session. The first sale for each type of inventory is more than the quantity on hand, so it prints the error message. If there is enough to sell, it prints out the price for that quantity plus tax, and displays the new listing.
Last synced: 17 Mar 2025
https://github.com/rphadtare/scala_by_examples
This repository consist sample programs to learn and understand core concepts
abstract-classes abstraction arrays case-classes encapsulation exception-handling high-order-function inheritance oop-in-scala polymorphism regex scala strings-manipulation traits tuples
Last synced: 08 Jun 2026
https://github.com/mohi-uddin-akbar/typescript-oop-concepts
Explore the fundamentals and advanced aspects of TypeScript with a focus on Object-Oriented Programming (OOP) concepts. Dive into abstract classes, inheritance, interfaces, generics, access modifiers, and more. This repository serves as a comprehensive guide to leveraging TypeScript for robust and maintainable software development.
abstract-classes access-modifiers generics inheritance oop programming-concepts setters-and-getters software-development static-methods typescript typescript-classes typescript-interfaces
Last synced: 13 Apr 2026
https://github.com/MOHI-UDDIN-AKBAR/typeScript-OOP-concepts
Explore the fundamentals and advanced aspects of TypeScript with a focus on Object-Oriented Programming (OOP) concepts. Dive into abstract classes, inheritance, interfaces, generics, access modifiers, and more. This repository serves as a comprehensive guide to leveraging TypeScript for robust and maintainable software development.
abstract-classes access-modifiers generics inheritance oop programming-concepts setters-and-getters software-development static-methods typescript typescript-classes typescript-interfaces
Last synced: 11 Jul 2025