0% found this document useful (0 votes)
26 views1 page

Student 1

The document defines a Student1 class with integer and string fields for student number and name, a constructor to initialize the fields, and a main method that creates a Student1 object and calls its display method to print the number and name.

Uploaded by

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

Student 1

The document defines a Student1 class with integer and string fields for student number and name, a constructor to initialize the fields, and a main method that creates a Student1 object and calls its display method to print the number and name.

Uploaded by

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

import java.io.

*;

class Student1
{

int Sno;
String Sname;
public Student1( int no, String name)
{
Sno = no ;
Sname = name ;
}

public static void main(String args[])


{
Student1 S1 = new Student1( 10 , "Aravind" );
S1.display();
}

public void display()


{
System.out.println(Sno);
System.out.println(Sname);
}

You might also like