COMP 328 Entire Course New Flashcards
COMP 328 Entire Course New
Check this A+ tutorial guideline at
https://www.assignmentcloud.com/comp-328-devry/comp-328-entire-course-new
For more classes visit
https://www.assignmentcloud.com/
COMP 328 Entire Course New
COMP 328 All ilabs weeks 1-6 / Devry University
Check this A+ tutorial guideline at
https://www.assignmentcloud.com/comp-328-devry/comp-328-entire-course-new
For more classes visit
https://www.assignmentcloud.com/
COMP 328 Final Guide New
Check this A+ tutorial guideline at
https://www.assignmentcloud.com/comp-328-devry/comp-328-final-guide-new
For more classes visit
https://www.assignmentcloud.com/
COMP 328 Final Guide New
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
4: Which of the following is a Scanner method?
a. nextLine
b. nextText
c. nextWord
d. readNext
5: Every Java application is required to have
a. at least one public static method.
b. at least one data member.
c. a String variable which holds the name of the application.
d. a content pane and several GUI components.
6: Which of the following statements about creating arrays and initializing their elements is false?
a. The new keyword should be used to create an array.
b. When an array is created, the number of elements must be placed in square brackets following the type of element being stored.
c. The elements of an array have unknown values just after the array has been created.
d. A for loop is an excellent way to initialize the elements of an array.
7: Assume the following class declaration.
class MyClass
{
int a;
String q;
public void firstMethod()
{
int b, ;
- 7;
+ c * a;
}
}
Mark the following statements as TRUE or FALSE.
q is a reference variable which refers to the empty string. __TRUE___ b and c are local variables. ___TRUE____ a, b, and c are primitive data types. ___FALSE____ MyClass is a Java application. ___FALSE____
8: Which statement below could be used to randomly select a state from an array which contains exactly 50 strings which are the names of the states?
1 + ( int ) ( Math.random( ) * 49 ); ( int ) ( Math.random( ) * 51 ); ( int ) ( Math.random( ) * 50 ); 1 + ( int ) ( Math.random( ) * 50 );
9: To draw a single line from (0, 15) to (20, 25), call the method _________ of the Graphics class in the paintComponent method.
a. drawLine( 0, 15, 20, 25 );
b. drawString( “single line”, 0, 15 );
c. drawLine( 0, 15, 20, 10 );
d. drawLine( 15, 0, 25, 20 );
10: In the Java graphics system, coordinate units are measured in ________.
a. dots
b. pixels
c. points
d. inches
11: Which is a correct way to invoke the static method sqrt of the Math class?
a. sqrt( 900 );.
b. math.sqrt( 900 );.
c. Math.sqrt( 900 );.
d. Math Math(); math.sqrt( 900 );.
12: When an object is concatenated with a String
a. a compilation error occurs.
b. a runtime error occurs.
c. the object’s toString method is implicitly called to obtain the String representation of the object.
d. the object’s class name is used.
13: What do the following statements do?
double array[];
double[ 14 ];
a. Creates a double array containing 13 elements.
b. Creates a double array containing 14 elements.
c. Creates a double array containing 15 elements.
d. Declares but does not create a double array.
14: Consider the class below:
public class Test { public static void main( String args[] ) { int a[]; int[ 10 ];
for ( int ; i
Check this A+ tutorial guideline at
https://www.assignmentcloud.com/comp-328-devry/comp-328-final-guide-new
For more classes visit
https://www.assignmentcloud.com/
COMP 328 Week 1 lab 1 New
Check this A+ tutorial guideline at
https://www.assignmentcloud.com/comp-328-devry/comp-328-week-1-lab-1-new
For more classes visit
https://www.assignmentcloud.com/
COMP 328 Week 1 lab 1 New
COMP 328 Week 1 lab 1
Check this A+ tutorial guideline at
https://www.assignmentcloud.com/comp-328-devry/comp-328-week-1-lab-1-new
For more classes visit
https://www.assignmentcloud.com/
COMP 328 Week 2 lab 2 New
Check this A+ tutorial guideline at
https://www.assignmentcloud.com/comp-328-devry/comp-328-week-2-lab-2-new
For more classes visit
https://www.assignmentcloud.com/
COMP 328 Week 2 lab 2 New
COMP 328 Week 2 lab 2
Check this A+ tutorial guideline at
https://www.assignmentcloud.com/comp-328-devry/comp-328-week-2-lab-2-new
For more classes visit
https://www.assignmentcloud.com/
COMP 328 Week 3 lab 3 New
Check this A+ tutorial guideline at
https://www.assignmentcloud.com/comp-328-devry/comp-328-week-3-lab-3-new
For more classes visit
https://www.assignmentcloud.com/
COMP 328 Week 3 lab 3 New
COMP 328 Week 3 lab 3
Check this A+ tutorial guideline at
https://www.assignmentcloud.com/comp-328-devry/comp-328-week-3-lab-3-new
For more classes visit
https://www.assignmentcloud.com/
COMP 328 Week 4 lab 4 New
Check this A+ tutorial guideline at
https://www.assignmentcloud.com/comp-328-devry/comp-328-week-4-lab-4-new
For more classes visit
https://www.assignmentcloud.com/
COMP 328 Week 4 lab 4 New
COMP 328 Week 4 lab 4
Check this A+ tutorial guideline at
https://www.assignmentcloud.com/comp-328-devry/comp-328-week-4-lab-4-new
For more classes visit
https://www.assignmentcloud.com/
COMP 328 Week 4 Midterm Exam New
Check this A+ tutorial guideline at
https://www.assignmentcloud.com/comp-328-devry/comp-328-week-4-midterm-exam-new
For more classes visit
https://www.assignmentcloud.com/
COMP 328 Week 4 Midterm Exam New
- What is UNIX?
a. Operating System
b. Company
c. Programming Language - Which company originally developed UNIX?
a. NASA
b. Novel
c. AT&T (BELL)
d. Apple
e. IBM - What is UNIX Shell?
a. A game
b. A command-line interpreter
c. A hardware
d. A text editor - Which command will display a Calendar?
a. cal
b. dis cal
c. view Cal
d. calendar - Which command can be used to display the contents of a file on the screen?
a. ls
b. grep
c. dog
d. cat - To list the permissions on files, which of the following commands will work?
a. ls
b. ls –a
c. ls –l
d. more –al - The ________ command will display the absolute pathname for the directory that you are wokring in.
a. dir
b. whereami
c. pwd
d. ls - To change access modes on files you can use the chmod command.
a. True
b. False - What does a Java class contain that identifies it as a Java application?
- How are static methods different from non-static methods? How do you invoke a static method? Give an example of a static method.
- Explain the difference between an object reference in Java and an object. Use an example to illustrate your answer.
- Explain how objects are created in Java and how the memory used by objects is recovered.
- 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.
- 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?
- What is the difference between throwing an exception and catching an exception?
- Explain the difference between a checked exception and an unchecked exception.
- What happens if an exception does not have a matching catch block?
- What can your program do with the exception object that a catch block receives?
- What is the purpose of the finally block?
Check this A+ tutorial guideline at
https://www.assignmentcloud.com/comp-328-devry/comp-328-week-4-midterm-exam-new
For more classes visit
https://www.assignmentcloud.com/
COMP 328 Week 5 lab 5 New
Check this A+ tutorial guideline at
https://www.assignmentcloud.com/comp-328-devry/comp-328-week-5-lab-5-new
For more classes visit
https://www.assignmentcloud.com/
COMP 328 Week 5 lab 5 New
COMP 328 Week 5 lab 5
Check this A+ tutorial guideline at
https://www.assignmentcloud.com/comp-328-devry/comp-328-week-5-lab-5-new
For more classes visit
https://www.assignmentcloud.com/
COMP 328 Week 6 lab 6 New
Check this A+ tutorial guideline at
https://www.assignmentcloud.com/comp-328-devry/comp-328-week-6-lab-6-new
For more classes visit
https://www.assignmentcloud.com/
COMP 328 Week 6 lab 6 New
COMP 328 Week 6 lab 6
Check this A+ tutorial guideline at
https://www.assignmentcloud.com/comp-328-devry/comp-328-week-6-lab-6-new
For more classes visit
https://www.assignmentcloud.com/