Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The Student class has a default constructor, a constructor with one parameter, and a constructor with three parameters. Declare the following objects: student 1 with

The Student class has a default constructor, a constructor with one parameter, and a constructor with three parameters. Declare the following objects:
student1 with no arguments
student2 with studentName as an argument
student3 with studentName, studentAge, and studentHeight as arguments
Ex: If the input is Mai 304.50, then the output is:
Student: Unspecified, 0,0.00
Student: Mai, 0,0.00
Student: Mai, 30,4.50
Club.java
Student.java
import java.util.Scanner;
public class Club {
public static void main(String[] args){
Scanner scnr = new Scanner(System.in);
String studentName;
int studentAge;
double studentHeight;
studentName = scnr.next();
studentAge = scnr.nextInt();
studentHeight = scnr.nextDouble();
/* Your code goes here */
student1.print();
student2.print();
student3.print();
}
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions