subject

Consider the following declaration***In Java*** Widget thing = new Widget();
Which of the following best describes the situation?

A. Widget is an object of the thing class type

B. thing is an object of the Widget class type

C. thing is a primitive value of the Widget type

D. Widget is a primitive value of the thing type

E. Widget and thing are both classes

Question 2
Which of the following is used to indicate a new line?

A. \\

B. \'

C. \n

D. \"

E. \t

Question 3
Look at the following code - assume that Game is a class that creates an object that represents the progress of a player within a video game. By default, the value stored is 1. Also assume that changeLevel() is a void method that will update the progress by adding 1 to the current value stored.

Game progress1 = new Game();
Game progress2 = progress1;
progress1.changeLevel();
What is true about progress1 and progress2?

A. The level of progress1 is changed to 2 by the changeLevel() method, but since it is not simultaneously changed for progress2, the level is not updated completely. Therefore the level of progress1 and progress2 are both 1.

B. An error occurs because progress2 is not properly created. You cannot set one object equal to another object.

C. An error occurs, because when progress1 is stored to progress2, progress1 no longer exists so changeLevel() can no longer be used on progress1.

D. progress1 and progress2 point to the same object, so the level of progress1 and progress2 are both now 2.

E. The value of the level stored in progress1 is now 2 and the the value stored in progress2 is 1.

Question 4
What is output?

int x = 10;
System. out. println(" " + x + 5);

A. 15

B. None of the above

C. x5

D. x10

E. 105

Question 5
Consider the following code:

String str = "Computer Science";
Which of the following statements correctly prints the first character in the String str?

A. System. out. println(str. substring(0));

B. System. out. println(str. substring(0, 0));

C. System. out. println(str. substring(1, 1));

D. System. out. println(str. substring(1, 2));

E. System. out. println(str. substring(0, 1));


Consider the following declaration***In Java***

Widget thing = new Widget();
Which of the followi
Consider the following declaration***In Java***

Widget thing = new Widget();
Which of the followi
Consider the following declaration***In Java***

Widget thing = new Widget();
Which of the followi

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 05:10
Read the code below. what will the computer print if the input for year_variable is 1700? if year_variable == 1776: print("your answer is correct. the declaration of independence was signed in “year_variable”.") elif year_variable < 1776: compute_variable = 1776 - year_variable. print("add “compute_variable“ years to your answer for the correct answer.") elif year_variable > 1776: compute_variable = year_variable - 1776 print("subtract “compute_variable” years from your answer for the correct answer.")
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
What side length would you specify if you were required to create a regular hexagonal plate that was composed of 33 cm(squared) of sheet metal? dimension the side length to 0.1 cm
Answers: 2
question
Computers and Technology, 23.06.2019 12:50
Which syntax error in programming is unlikely to be highlighted by a compiler or an interpreter? a variable name misspelling a missing space a comma in place of a period a missing closing quotation mark
Answers: 1
question
Computers and Technology, 24.06.2019 11:20
William travels a lot on business purpose. he needs to regularly communicate with his business partner. he also needs to send out weekly reports to his boss while he is traveling. which web-based application best suits william’s needs? (social media, webmail, wiki) is the best web-based application for william. he can access this application via the internet using a (digital cable, fax machine, web browser).
Answers: 1
You know the right answer?
Consider the following declaration***In Java*** Widget thing = new Widget();
Which of the fol...
Questions
Questions on the website: 13722367