Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
RathoreUtkarsh authored Oct 31, 2022
1 parent 11e4841 commit a2f4828
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions Single.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import java.util.Scanner;
class Studentdetails
{
String name;
int age;
int rollno;
Scanner sc=new Scanner(System.in);
void input()
{
System.out.println("enter the name of student");
name= sc.nextLine();
System.out.println("enter the age of student");
age=sc.nextInt();
System.out.println("enter the rollno of the student");
rollno=sc.nextInt();
}
void display()
{
System.out.println("Name:" +name);
System.out.println("Age:" +age);
System.out.println("Roll no:" +rollno);
}
}
class Student extends Studentdetails
{
private int a,b,c;
void Academics()
{
input();
System.out.println("enter the marks of physics");
a=sc.nextInt();
System.out.println("enter the marks of maths " );
b=sc.nextInt();
System.out.println("enter the marks of chemistry");
c=sc.nextInt();
}
void getDisplay()
{
display();
System.out.println("Physics:" +a);
System.out.println("Maths:" +b);
System.out.println("Chemistry:" +c);
}
}
class Single{
public static void main(String args[])
{
Student S=new Student();
S.Academics();
S.getDisplay();
}
}

0 comments on commit a2f4828

Please sign in to comment.