Computer Science, asked by chiyaanvikramfan, 11 months ago

write a java program to prepare student marklist using single inheritance​

Answers

Answered by GeekyJS
1

Answer:

import java.io.*; class Student { int roll; String cname; String uname; InputStreamReader in = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(in); void input() throws IOException { System.out.print("Enter Roll Number :"); roll = Integer.parseInt(br.readLine()); System.out.print("\nEnter College Name :"); cname = br.readLine(); System.out.print("\nEnter University Name :"); uname = br.readLine(); } } class Main extends Student { void display() { System.out.print("\nRoll Number is :" + roll); System.out.print("\nCollege Name is :" + cname); System.out.print("\nUniversity Name is :" + uname); } public static void main(String args[]) throws IOException { Main c = new Main(); c.input(); c.display(); } }

Hope it's helpful to you.

Similar questions