Added 25 solutions
This commit is contained in:
+30
@@ -0,0 +1,30 @@
|
||||
// Author: Rodney Shaghoulian
|
||||
// Github: github.com/rshaghoulian
|
||||
// HackerRank: hackerrank.com/rshaghoulian
|
||||
|
||||
import java.util.*;
|
||||
import java.io.*;
|
||||
|
||||
class BiCycle {
|
||||
String define_me() {
|
||||
return "a vehicle with pedals.";
|
||||
}
|
||||
}
|
||||
|
||||
class MotorCycle extends BiCycle {
|
||||
String define_me() {
|
||||
return "a cycle with an engine.";
|
||||
}
|
||||
|
||||
MotorCycle() {
|
||||
System.out.println("Hello I am a motorcycle, I am " + define_me());
|
||||
String temp = super.define_me();
|
||||
System.out.println("My ancestor is a cycle who is " + temp);
|
||||
}
|
||||
}
|
||||
|
||||
class Solution {
|
||||
public static void main(String [] args) {
|
||||
MotorCycle M = new MotorCycle();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user