Guest User

Untitled

a guest
Feb 17th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. public class Student {
  2. int id;
  3. String name;
  4. double marks;
  5.  
  6. public Student(int id, String name, double marks) {
  7. id = this.id;
  8. name = this.name;
  9. marks = this.marks;
  10. }
  11. }
  12.  
  13. public class Solution {
  14. public static void main(String[],args)
  15. {
  16. Scanner sc = new Scanner(System.in);
  17. int n=sc.nextInt();
  18. Student[] arr=new Student[n];
  19. for(int i=0;i<n;i++)
  20. {
  21. int x =sc.nextInt();
  22. String y=sc.nextLine();
  23. double z=sc.nextDouble();
  24. arr[i]=arr.Student(x,y,z);
  25. }
  26. }
  27. }
Add Comment
Please, Sign In to add comment