0% found this document useful (0 votes)
2 views2 pages

Student

The Java program defines a 'Student' class with attributes for roll number, name, and marks. It includes methods to input data and display it. In the main method, an instance of 'Student' is created, data is set, and the output is printed to the console.

Uploaded by

vj2semister
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Student

The Java program defines a 'Student' class with attributes for roll number, name, and marks. It includes methods to input data and display it. In the main method, an instance of 'Student' is created, data is set, and the output is printed to the console.

Uploaded by

vj2semister
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

import java.lang.

*;
class Student {
int Roll_no;
String name;
int marks;

public void getdata(int r, String n, int m) {


Roll_no = r;
name = n;
marks = m;
}

public void putdata() {


System.out.println(">>>>>>>>>>>>>>>>>>> OUTPUT >>>>>>>>>>>>>>>");
System.out.println("Roll Number = " + Roll_no);
System.out.println("Name of the student = " + name);
System.out.println("Marks of the student = " + marks);
}

public static void main(String args[]) {


Student s1 = new Student();
// Using user-provided values:
s1.getdata(75, "Jadhav Vishal tikaram ", 100);
s1.putdata();
}
}
>>>>>>>>>>>>>>>>>>> OUTPUT >>>>>>>>>>>>>>>
Roll Number = 75
Name of the student = Jadhav Vishal tikaram
Marks of the student = 100

You might also like