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 Bank
  9. {
  10. int get()
  11. {
  12. return 0;
  13. }
  14. }
  15. class SBI extends Bank
  16. {
  17. int get()
  18. {
  19. int sbi;
  20. Scanner in = new Scanner(System.in);
  21. sbi=in.nextInt();
  22. return sbi;
  23. }
  24. }
  25. class ICICI extends Bank
  26. {
  27. int get()
  28. {
  29. return 8;
  30. }
  31. }
  32. class AXIS extends Bank
  33. {
  34. int get()
  35. {
  36. return 9;
  37. }
  38. }
  39. class check
  40. {
  41. public static void main(String args[]){
  42. SBI s=new SBI();
  43. ICICI i=new ICICI();
  44. AXIS a =new AXIS();
  45. System.out.println("SBI Rate of Interest: "+s.get());
  46. }
  47. }
Success #stdin #stdout 0.16s 51684KB
stdin
4
stdout
SBI Rate of Interest: 4