Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Doubt-" 1 parameter Gen _Derive_Class inherit the 2 parameter Gen_Base...
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class GenBase<T,V> { T tbase; V vbase; public GenBase(T t,V v) { tbase=t; vbase=v; } public GenBase(T t) { tbase=t; } public GenBase(V v) { vbase=v; } public void BDisplay() { Console.WriteLine("Base_t: ",tbase); Console.WriteLine("Base_v: ",vbase); } } public class GenDerive<T>:GenBase<T,V> { T tderiv; public GenDerive(T t) { tderiv=t; } public GenDerive(T t,T v):base(v) { tderiv=t; } public void DDisplay() { Console.WriteLine("Deriv_t: ",tderiv); Console.WriteLine("Base_v: ",vbase); } } public class Program { public static void Main(string[] args) { GenBase<int,string> gb=new GenBase<int,string>(10,"Hello"); GenBase<string,int> gb2=new GenBase<string,int>("Hello",10); GenDerive<string> gd=new GenDerive<string>(20,"Hii"); GenDerive<int> gd2=new GenDerive<int>(10,15); } } }
Show compiler warnings
[
+
]
Show input
Compilation time: 0.02 s
fork mode
|
history
|
discussion