wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

CSE 15L Lab 9

Total questions: 8

Worksheet time: 4mins

Name
Class
Date
1.

What is the difference between -cp and cp?

a)

cp does not exist, we only use -cp

b)

they are the same

c)

-cp stands for class path and is a command line option for java, cp is for copying file/folders

d)

-cp does not exist, we only use cp

2.

When do you need to use this command: javac -cp .:lib/hamcrest-core-1.3.jar:lib/junit-4.13.2.jar *.java instead of javac *.java?

a)

always use the first command no matter what

b)

Use the first command when compiling junit tests

c)

always use the second command no matter what

d)

they can be used interchangeably

3.

Which path is the same as directory1/directory2/directory3/../../file.txt?

a)

directory1/file.txt

b)

directory1/directory2/file.txt

c)

directory1/directory3/file.txt

d)

directory2/directory3/file.txt

4.

Which version of the junit command that we introduced in lab do we use to compile and run junit tests on ieng6?

a)

Mac

b)

Windows

c)

neither

d)

both work

5.

Which of the following is correct?

a)

java [fileName].java

b)

javac [fileName]

c)

java [fileName]

d)

javac [fileName].class

6.

In this folder there is testing.java, grader.sh, listExample.java, hamcrest-core-1.3.jar, and junit-4.13.2.jar. What does running this command give us an error (assuming we are on mac)

java -cp .:lib/hamcrest-core-1.3.jar:lib/junit-4.13.2.jar org.junit.runner.JUnitCore testing

a)

it doesn't give an error

b)

should be this command

java -cp ".;lib/junit-4.13.2.jar;lib/hamcrest-core-1.3.jar" org.junit.runner.JUnitCore testing

c)

missing .java at the end(testing.java)

d)

wrong path: missing lib folder

7.

What does it indicate if you receive this error message java.lang.IllegalArguementException: Could not find class [TestListExamples.java]?

a)

TestListExamples.java does not exist

b)

TestListExamples.java does not exist in the current working directory

c)

The programmer should not have included .java

d)

all of the above are possible

8.

Which of the following is NOT a valid way to represent the working directory path?

a)

./working_directory

b)

../working_directory

c)

/working_directory

d)

~working_directory