Question: When answering the following questions, consider this program; comments indicate where missing needed components of the program are to be placed. public class MyClass {

When answering the following questions, consider this program; comments indicate where missing needed components of the program are to be placed.

public class MyClass { // (1) definition of MyClass constructor public static void greetings() { // definition of greets } public void update(int num, String title) { // definition of update } } public class MainClass { //definition of a function that prints out a greeting public static void main(String[] args) { //(2) print the greeting //(3) construct a MyClass object called myObject //(4) update myObject } }

a) Write the header of MyClass constructor (line (1) above)

b) Write a statement to call the method that prints the greeting, at line(2) above. Note that myObject is an object of MyClass defined in the question above.

c) Create an object, called myObject, from data type MyClass at line (3) above.

d) Call the update method for myObject at line(4) above with arguments 3 and "Hi".

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!