What do you want to save?
Add Code snippet
New code examples
-
Java 2021-10-13 20:11:06
abstract class vs interface java
Sometimes we may come across a situation where we cannot provide implementation to all the methods in a class. We want to leave the implementation to a class that extends it. In such case we declare a class as abstract.To make a class abstract we use ke... Add solution -
C++ 2021-10-10 21:27:08
what is abstract class in c++
//Code by Soumyadeep Ghosh //insta : @soumyadepp //linked in : https://www.linkedin.com/in/soumyadeep-ghosh-90a1951b6/ #include <bits/stdc++.h> using namespace std; class person { string p_id; public: virtual void get_info()=0; //declaring ... Add solution -
Other 2021-10-09 00:04:04
random kotlin cannot create instance of abstract class
Just remove the parentheses: Random.nextInt(7). Like this it uses the companion object (Default) of class Random which implements the abstract class Random with a default behaviour. From the documentation: The companion object Random.Default is the d... Add solution -
C# 2021-10-07 17:04:05
design pattern for so many conditions c#
class ActionState { public bool Condition1{get;set;} public bool Condition2{get;set;} public bool Condition3{get;set;} } abstract class ActionDispatcher { protected abstract void ExecuteAction1(); protected abstract void ExecuteAction2(); pro... Add solution -
C# 2021-10-02 03:48:06
c# get all inherited classes of a class
//through reflection using System.Reflection; //as a reusable method/function Type[] GetInheritedClasses(Type MyType) { //if you want the abstract classes drop the !TheType.IsAbstract but it is probably to instance so its a good idea to keep it. ret... Add solution -
Other 2021-09-30 14:13:02
how to use abstraction in your project
I used in defining a common super class while writing POM layer of the framework We usually create an abstract class named BasePage to have all common members for every page written in this class like getPageTitle(). Then each Page class (HomePage, LoginP... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5