Devry CIS 355A Week 5 Quiz latest

$14

Quantity:

Description

Devry CIS 355A Week 5 Quiz latest

  1. 1.Question : (TCOs 1–8) Given a graphics object g,

to draw a line from the upper left corner to the bottom right corner, you use _____

g.drawLine(0, 0, getHeight(), getHeight()).

g.drawLine(0, 0, 100, 100).

g.drawLine(0, 0, getWidth(), getHeight()).

g.drawLine(0, 0, getWidth(), getWidth()).

Question 2. Question : (TCOs 1–8) Which of the following statements is false?

You can create a FileInputStream/FileOutputStream from a File object or a file name using FileInputStream/FileOutputStream constructors.

A java.io.FileNotFoundException would occur if you attempt to create a FileOutputStream with a nonexistent file.

All methods in FileInputStream/FileOutputStream are inherited from InputStream/OutputStream.

The return value -1 from the read() method signifies the end of file.

A java.io.FileNotFoundException would occur if you attempt to create a FileInputStream with a nonexistent file.

Question 3. Question : (TCOs 1–8) Given a graphics object g,

to draw a filled oval with width 20 and height 30 centered at (50, 50), you use _____

g.fillOval(30, 30, 40, 30).

g.fillOval(30, 30, 20, 30).

g.fillOval(40, 35, 20, 30).

g.fillOval(50, 50, 20, 30).

g.fillOval(50, 50, 40, 30).

Question 4. Question : (TCOs 1–8) Which of the following statements is correct to create a DataOutputStream to write to a file named out.dat?

DataOutputStream outfile = new DataOutputStream(FileOutputStream(“out.dat”));

DataOutputStream outfile = new DataOutputStream(new File(“out.dat”));

DataOutputStream outfile = new DataOutputStream(new FileOutputStream(“out.dat”));

DataOutputStream outfile = new DataOutputStream(“out.dat”);

Question 5. Question : (TCOs 1-8) With which I/O class can you append or update a file?

DataOutputStream()

RandomAccessFile(),

OutputStream()

None of them

Question 6. Question : (TCOs 1–8) “abc”.compareTo(“aba”) returns _____

2.

1.

-2.

0.

-1.

Question 7. Question : (TCOs 1–8) Which code fragment would correctly identify the number of arguments passed via the command line to a Java application, excluding the name of the class that is being invoked?

int count=0; while (!(args[count].equals(“”))) count ;

int count = args.length;

int count = args.length – 1;

int count = 0; while (args[count] != null) count ;

Question 8. Question : (TCOs 1–8) Assume s is “ABCABC”, the method _____ returns an array of characters.

String.toChars()

s.toChars()

toChars(s)

String.toCharArray()

s.toCharArray()

Question 9. Question : (TCOs 1–8) What is the output of the following code?

public class Test {

public static void main(String[ ] args) {

String s1 = “Welcome to Java!”;

String s2 = “Welcome to Java!”;

if (s1 == s2)

System.out.println(“s1 and s2 reference to the same String object”);

else

System.out.println(“s1 and s2 reference to different String objects”);

}

}

s1 and s2 reference to the same String object

s1 and s2 reference to different String objects

Question 10. Question : (TCOs 1–8) Which class do you use to write data into a text file?

File

PrintWriter

System

Scanner

 

DeVry Courses helps in providing the best essay writing service. If you need 100% original papers for Devry CIS 355A Week 5 Quiz latest, then contact us through call or live chat.

Devry CIS 355A Week 5 Quiz latest

Best Devry CIS 355A Week 5 Quiz latest

Devry CIS 355A Week 5 Quiz latest