Course Hero Logo

Analyze the following code class test private double

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 14 - 17 out of 22 pages.

84)Analyze the following code:class Test {private double i;public Test(double i) {this.t();this.i=i;}public Test() {System.out.println("Default constructor");this(1);}public void t() {System.out.println("Invoking t");}}(choose all that apply)84)A)this.i may be replaced by i.B)this.t() may be replaced by t().C)this(1) must be replaced by this(1.0).D)this(1) must be called before System.out.println("Default constructor").
85)The internal state of an immutable class cannot be changed. String is an immutable class.85)
86)You can always assign a value of long type to a variable of int type without loss of precision.86)
87)The conditional operator ? : is a ________.87)
14
We have textbook solutions for you!
/Systems-Architecture-7th-Edition-9781305080195-1466/
The document you are viewing contains questions related to this textbook.
Chapter 3 / Exercise 10
Systems Architecture
Burd
Expert Verified
88)Analyze the following statement:double sum=0;for (double d=0; d<10;) {d+=0.1;sum+=sum+}88)d;A)The program has a syntax error because the control variable in the for loop cannot be ofthe double type.B)The program runs in an infinite loop because d<10 would always be true.C)The program compiles and runs fine.D)The program has a syntax error because the adjustment is missing in the for loop.
89)Variables defined inside a method are called ________.89)
90)________ declares an array of char. (choose all that apply)90)
91)How many JFrame objects can you create and how many can you display?91)
92)Which of the following statements are true?A)If a file (e.g., c:\temp.txt) does not exist, new File("c:\\temp.txt") creates a new filenamed c:\temp.txt.B)If a file (e.g., c:\temp.txt) does not exist, new File("c:\\temp.txt") returns null.C)If a directory (e.g., c:\liang) does not exist, new File("c:\liang") creates a new directorynamed c:\liang.D)If a directory (e.g., c:\liang) does not exist, new File("c:\liang") returns null.E)None of the above.92)
15
93)What is the printout for the third statement in the main method?public class Foo {static int i=0;static int j=0;public static void main(String[] args) {int i=2;int k=3;{int j=3;System.out.println("i+j is "+i+}k=i+System.out.println("k is "+k);System.out.println("j is "+j);}}A)j is 1B)j is 2C)j is 0D)j is 393)94)-25 % 5 is ________.j);j;94)
95)What is the printout of the following switch statement?char ch='b';switch (ch) {case 'a':System.out.print(ch);case 'b':System.out.print(ch);case 'c':System.out.print(ch);case 'd':System.out.print(ch);}95)

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 22 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
N/A
Tags
We have textbook solutions for you!
The document you are viewing contains questions related to this textbook.
Systems Architecture
The document you are viewing contains questions related to this textbook.
Chapter 3 / Exercise 10
Systems Architecture
Burd
Expert Verified

Newly uploaded documents

Show More

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture