Analyze the following code:
```
public class Test {
public static void main(String[] args) {
A a = new A();
a.print();
}
}
class A {
String s;
A(String s) {
this.s = s;
}
void print() {
System.out.println(s);
}
}
```
a. The program has a compile error because class A is not a public class.
b. The program has a compile error because class A does not have a default constructor.
c. The program compiles and runs fine and prints nothing.
d. The program would compile and run if you change A a = new A() to A a = new A("5").
b. The program has a compile error because class A does not have a default constructor.
d. The program would compile and run if you change A a = new A() to A a = new A("5").
You might also like to view...
When you use a form to add or change the data in a record, you have to use the Refresh All button on the ____ tab to update the corresponding table.
A. DATABASE TOOLS B. CREATE C. HOME D. FILE
Valid values for the type attribute of the
A. submit B. reset C. push D. button
What is a parameter query and how is it used?
What will be an ideal response?
________ is the security guarantee that people who intercept messages cannot read them.
A. Confidentiality B. Encryption C. Availability D. Integrity