Classes and Object Concepts in JAVA

Can anyone please help me to solve this question ?

Create a class named ‘Student’ with String variable ‘name’ and integer variable ‘roll_no’.
You need to perform the below operations:

  • Assign the value of roll_no as given by the user

  • Assign the value of name as given by the user

by creating an object of the class “Student”.
Finally, you have to return object of Student created.

Thanks . I have created object using new keyword .

That is good.

Please show us your code so far.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.