COMP 328 Entire Course (Devry)
For more course tutorials visit
www.comp328.com
Comp 328 ilabs
COMP 328 Week 4 Midterm Exam
COMP 328 Final Exam
..............................................................................................................................................................................
COMP 328 Final Exam (Devry)
For more course tutorials visit
www.comp328.com
COMP 328
Java Exam
Select the best answer.
1: The .class extension on a file means that the file
a.contains Java source code.
b.contains HTML.
c.is produced by the Java compiler (javac).
d.contains a machine specific executable image.
2: Which command compiles the Java source code file Welcome.java?
a.cd Welcome.java
b.javac Welcome.java
c.java Welcome.java
d.compile Welcome.java
3: A(n) ________ enables a program to read data from the user.
a.printf
b.import declaration
c.Scanner
d.main routine
.......................................................................................................................................................................
COMP 328 Week 4 Midterm Exam (Devry)
For more course tutorials visit
www.comp328.com
9. What does a Java class contain that identifies it as a Java application?
10. How are static methods different from non-static methods? How do you invoke a static method? Give an example of a static method.
11. Explain the difference between an object reference in Java and an object. Use an example to illustrate your answer.
12. Explain how objects are created in Java and how the memory used by objects is recovered.
13. How do you get the first character of a string in Java? How do you access the last character of a string? Use Java code to illustrate your answer.
14. How would you write an expression in Java to generate a random integer value between 100 and 200, where the numbers 100 and 200 were both included in the set of possible numbers that could be generated?
16....