I need answer of all this question if someone can help me. public class SchoolCl
ID: 3858872 • Letter: I
Question
I need answer of all this question if someone can help me.
public class SchoolClient{
public static void main (String [ ] args) {
School school1 = new School ();
School school2 = new School ("UMass Lowell");
school1.setname ("Middlesex Community College");
System.out.println (school1.getname());
System.out.println (school2.getname());
}
}
school1
b school2
c
school1 & school2
School
2.
Looking at the following client class, how many constructor methods does the School class have? public class SchoolClient{
public static void main (String [ ] args) {
School school1 = new School ();
School school2 = new School ("UMass Lowell");
school1.setname ("Middlesex Community College");
System.out.println (school1.getname());
System.out.println (school2.getname());
}
}
a 1
b 2
3
d 4
3.
looking at the following client, which of the following method(s) take a parameter in the School class?
public class SchoolClient{
public static void main (String [ ] args) {
School school1 = new School ();
School school2 = new School ("UMass Lowell");
school1.setname ("Middlesex Community College");
System.out.println (school1.getname());
System.out.println (school2.getname());
}
}
setname
getname
setname and the constructor
setname & getname
aschool1
b school2
c
school1 & school2
DSchool
2.
Looking at the following client class, how many constructor methods does the School class have? public class SchoolClient{
public static void main (String [ ] args) {
School school1 = new School ();
School school2 = new School ("UMass Lowell");
school1.setname ("Middlesex Community College");
System.out.println (school1.getname());
System.out.println (school2.getname());
}
}
a 1
b 2
c3
d 4
3.
looking at the following client, which of the following method(s) take a parameter in the School class?
public class SchoolClient{
public static void main (String [ ] args) {
School school1 = new School ();
School school2 = new School ("UMass Lowell");
school1.setname ("Middlesex Community College");
System.out.println (school1.getname());
System.out.println (school2.getname());
}
}
asetname
bgetname
csetname and the constructor
dsetname & getname
Explanation / Answer
Dear Student,
here are the answers...
---------------------------------------------------------------------------------------------------------------------------------------
Answer No: 1
NOTE: Question number first problem statement is missing.Kindly state the problem.
---------------------------------------------------------------------------------------------------------------------------------------
Answer No:2 Option (b) is correct.
There are two constructor methods which the School class have?
1: Default Constructor
Ex: School school1 = new School ();
2: Parameterized Constructor
Ex: School school2 = new School ("UMass Lowell");
Hence option (b) is correct.
------------------------------------------------------------------------------------------------------------------------------------------
Answer No:3 Option C is correct.
School school2 = new School ("UMass Lowell"); (This is the Constructor)
school1.setname ("Middlesex Community College"); (This is the setname method)
SO the above two methods takes the parameters.
hence option C is correct.
-----------------------------------------------------------------------------------------------------------------------------------------
Kindly Check and Verify Thanks...!!!
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.