-
Notifications
You must be signed in to change notification settings - Fork 389
Open
Description
Is it just me or in most of the examples the spacing is all messed up, sometimes it is 1 space, then 4, then none
Lines 3 to 6 in a22280e
| class A{ | |
| private int data=40; | |
| private void msg(){System.out.println("Hello java");} | |
| } |
Lines 6 to 23 in a22280e
| abstract class Bank{ | |
| abstract int getRateOfInterest(); | |
| } | |
| class SBI extends Bank{ | |
| int getRateOfInterest(){return 7;} | |
| } | |
| class PNB extends Bank{ | |
| int getRateOfInterest(){return 8;} | |
| } | |
| class TestBank{ | |
| public static void main(String args[]){ | |
| Bank b; | |
| b=new SBI(); | |
| System.out.println("Rate of Interest is: "+b.getRateOfInterest()+" %"); | |
| b=new PNB(); | |
| System.out.println("Rate of Interest is: "+b.getRateOfInterest()+" %"); | |
| }} |
Lines 8 to 12 in a22280e
| abstract class Bike{ | |
| Bike(){System.out.println("bike is created");} | |
| abstract void run(); | |
| void changeGear(){System.out.println("gear changed");} | |
| } |
Lines 6 to 15 in a22280e
| abstract class Bike{ | |
| abstract void run(); | |
| } | |
| class Honda4 extends Bike{ | |
| void run(){System.out.println("running safely..");} | |
| public static void main(String args[]){ | |
| Bike obj = new Honda4(); | |
| obj.run(); | |
| } | |
| } |
Lines 3 to 19 in a22280e
| class Student4{ | |
| int id; | |
| String name; | |
| Student4(int i,String n){ | |
| id = i; | |
| name = n; | |
| } | |
| void display(){System.out.println(id+" "+name);} | |
| public static void main(String args[]){ | |
| Student4 s1 = new Student4(111,"Karan"); | |
| Student4 s2 = new Student4(222,"Aryan"); | |
| s1.display(); | |
| s2.display(); | |
| } | |
| } |
Metadata
Metadata
Assignees
Labels
No labels