fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. System.out.println(8%
  13. 10);
  14.  
  15. }
  16. }
  17. class Person{
  18.  
  19. public void eat(){
  20.  
  21. System.out.println("yummy");
  22.  
  23. }
  24.  
  25. public void walk(){
  26.  
  27. System.out.println("use legs");
  28.  
  29. }
  30.  
  31. public void breathe(){
  32.  
  33. System.out.println("need air");
  34.  
  35. }
  36.  
  37. }
  38. class Student extends Person{
  39.  
  40. public void eat(Person other){
  41.  
  42. System.out.println("eat food together");
  43.  
  44. }
  45.  
  46. public void party(){
  47.  
  48. System.out.println("friday night");
  49.  
  50. }
  51.  
  52. public void breathe(){
  53.  
  54. System.out.println("long breaths");
  55.  
  56. }
  57.  
  58. }
  59. class Faculty extends Person{
  60.  
  61. public void eat(){
  62.  
  63. System.out.println("fast eaters");
  64.  
  65. }
  66.  
  67. public void walk(){
  68.  
  69. System.out.println("fast walkers");
  70.  
  71. }
  72.  
  73. public void lecture(){
  74.  
  75. eat();
  76.  
  77. System.out.println("be clear");
  78.  
  79. }
  80.  
  81. }
  82. class CSEStudent extends Student{
  83.  
  84. public void eat(CSEStudent other){
  85.  
  86. System.out.println("dine with prof");
  87.  
  88. }
  89.  
  90. public void eat(Person other){
  91.  
  92. System.out.println("eat pizza together");
  93.  
  94. }
  95.  
  96. public void walk(){
  97.  
  98. System.out.println("walk fast");
  99.  
  100. }
  101.  
  102. public void game(){
  103.  
  104. System.out.println("fun");
  105.  
  106. }
  107.  
  108. }
  109. class CSEFaculty extends Faculty{
  110.  
  111. public void walk(){
  112.  
  113. super.walk();
  114.  
  115. System.out.println("use segway");
  116.  
  117. }
  118.  
  119. public void eat(){
  120.  
  121. System.out.println("bot feeds me");
  122.  
  123. }
  124.  
  125. public void game(){
  126.  
  127. lecture();
  128.  
  129. System.out.println("love it");
  130.  
  131. }
  132.  
  133. }
Success #stdin #stdout 0.04s 4386816KB
stdin
Standard input is empty
stdout
8