Question 3: What will be the output of the following code? Explain your solution. class BDCitizen{ protected String nid; public BDCitizen(String nid){ this.nid = nid; System.out.println("Initializing...

answer fastQuestion 3: What will be the output of the following code? Explain your solution.<br>class BDCitizen{<br>protected String nid;<br>public BDCitizen(String nid){<br>this.nid = nid;<br>System.out.println(

Extracted text: Question 3: What will be the output of the following code? Explain your solution. class BDCitizen{ protected String nid; public BDCitizen(String nid){ this.nid = nid; System.out.println("Initializing BDCitizen ... with this.nid = } } class Student extends BDCitizen{ protected int roll; public Student(String nid, int roll){ super(nid); this.roll = roll; System.out.println("Initializing Student ... with this.roll = } } + this.nid); + this.roll); class RegisteredStudent extends Student protected double cgpa; public RegisteredStudent(String nid, int roll, double cgpa){ super(nid, roll); this.cgpa = cgpa; System.out.println("Initializing RegisteredStudent ... with this.cgpa = } + this.cgpa); public class Main { public static void main(String[] args) { RegisteredStudent rs = new RegisteredStudent("NID-1", 7, 3.93); } }

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here