2017-09-22 11 views

答えて

0

これは動作しますが、

class Student{ 
int rollno; 
String name; 
float fee; 
Student(int rollno,String name,float fee){ 
this.rollno=rollno; 
this.name=name; 
this.fee=fee; 
} 
void display(){System.out.println(rollno+" "+name+" "+fee);} 
} 

class TestThis2{ 
public static void main(String args[]){ 
Student s1=new Student(111,"ankit",5000f); 
Student s2=new Student(112,"sumit",6000f); 
s1.display(); 
s2.display(); 
}} 

OUTPUT:

111 ankit 5000

112 sumit 6000

関連する問題