Professional Documents
Culture Documents
Multiple Choice Questions (10 Points) : What Is The Name of The Java File Containing This Program?
Multiple Choice Questions (10 Points) : What Is The Name of The Java File Containing This Program?
3.
What is printed?
A. B. C. D. E. 6 7 8 Columbia river
CSC142 Quiz 1 2
4. A. B. C. D. E. 5. A. B. C. D. E. 6.
A constructor
must have the same name as the class it is declared within. is used to create objects. may be declared private A and B A, B and C
7.
Consider public class MyClass{ public MyClass(){/*code*/} // more code... } To instantiate MyClass, you would write?
A. B. C. D. E. MyClass mc = new MyClass(); MyClass mc = MyClass(); MyClass mc = MyClass; MyClass mc = new MyClass; It can't be done. The constructor of MyClass should be defined as public void MyClass(){/*code*/}
8.
CSC142 Quiz 1 3
9.
10. You read the following statement in a Java program that compiles and