-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
11e4841
commit a2f4828
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |