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.

Firstly, welcome to the forums.

While we are primarily here to help people with their Free Code Camp progress, we are open to people on other paths, too.

With your current questions, we don’t have enough context to know what you already know or don’t know, so it is impossible to guide you without just telling you the answer (which we won’t do).

It is pretty typical on here for people to share a codepen / / jsfiddle example of what they have tried so that anyone helping has more of an idea of what help is actually helpful.

Please provide some example of what you’ve tried and I’m sure you’ll get more help.

Happy coding :slight_smile:

1 Like

Thanks . I have created object using new keyword .

That is good.

Please show us your code so far.

1 Like