Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Student {
- int id;
- String name;
- double marks;
- public Student(int id, String name, double marks) {
- id = this.id;
- name = this.name;
- marks = this.marks;
- }
- }
- public class Solution {
- public static void main(String[],args)
- {
- Scanner sc = new Scanner(System.in);
- int n=sc.nextInt();
- Student[] arr=new Student[n];
- for(int i=0;i<n;i++)
- {
- int x =sc.nextInt();
- String y=sc.nextLine();
- double z=sc.nextDouble();
- arr[i]=arr.Student(x,y,z);
- }
- }
- }
Add Comment
Please, Sign In to add comment