title: Java how to get and show simple data
body: <p>I need to get data and show it.</p>
  <p>This is my question</p>
  <pre><code>Construct a class designed to perform that takes student record containing Roll Number, Name and Marks
  as data and functions like get()and show() to take input in data and display data.
  </code></pre>
  <p>I am trying to do like this</p>
  <pre><code>import java.util.Scanner;
  
  class Student {
      String name;
      String stu_id;
      int score;
      public Student() {
          this(&quot; &quot;, &quot; &quot;, 0);
      }
      public Student(String initName, String initId, int initScore) {
          name = initName;
          stu_id = initId;
          score = initScore;
      }
  }
  
  public class Main {
      public static void main(String[] args) {
          Scanner in = new Scanner(System.in);
          System.out.println(&quot;Input number of students:&quot;);
          int n = Integer.parseInt(in.nextLine().trim());
          System.out.println(&quot;Input Student Name, ID, Score:&quot;);
          Student stu = new Student();
          for (int i = 0; i &lt; n; i ++) {
              stu.name = in.next();
              stu.stu_id = in.next();
              stu.score = in.nextInt();
              System.out.println(stu.name + &quot; &quot; + stu.stu_id);
  
          }
          System.out.println(&quot;name, ID of the highest score and the lowest score:&quot;);
          System.out.println(stu.name + &quot; &quot; + stu.stu_id);
          in.close();
      }
  }
  </code></pre>
  <p>But its wrong I just need to create a function show() on which ill get data and from get() function it will just print</p>