Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using Java, I want he right answer!!! Question 1: (practice to write the code fo

ID: 3852244 • Letter: U

Question

Using Java, I want he right answer!!!

Question 1: (practice to write the code for no-argument constructor and parameter constructor) This question talks about the class named TheClass that hold 4 private data members as below:

public class TheClass {

//data members

private String subject;

private String classSession;

private String roomNumber;

private String instructorID;

//no-argument constructor ……………..

//parameter constructor ……………. }

a. Write a parameter no-argument constructor for TheClass.

b. Write a parameter constructor that accepta 4 String parameters to initialize values to the field subject, classSession, roomNumber and instructorID

Explanation / Answer

JAVA CLASS:

public class TheClass {
//data members

private String subject;
private String classSession;
private String roomNumber;
private String instructorID;
  
  
//no-argument constructor ……………..

public TheClass() {
}
  
  
//parameter constructor …………….

public TheClass(String subject, String classSession, String roomNumber, String instructorID) {
this.subject = subject;
this.classSession = classSession;
this.roomNumber = roomNumber;
this.instructorID = instructorID;
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote