Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

kindly give the correct ans to the questions!!!! everything is here, the questions are already given there as well as the options, kindly answer them

kindly give the correct ans to the questions!!!! image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
everything is here, the questions are already given there as well as the options, kindly answer them
image text in transcribed
image text in transcribed
image text in transcribed
a. sur carrint 1 ine ierilief (iir) rept hare s is atiyctem delrepd? F. June prematre infial cohibuetst. teresit bene I Trust Ofine A objoc oneried pogrmoneg clasans aw the L_ in de forsestion ef a noutem - pripesiter is noun E. blentiven 4. witit annel Mense iocation Srenct one O. Trum Cfike c. ratodef be irelernimine at s class feftad of x a. r ihoulete inderrented ai a katace method at s Two oblekch of the aame disen haw fle same stati. a. cart and uitaty ae b. een bit nomuly doun c. must not a mal. Question 11 Not yet answered Marked out of 200 A try statement must be followed by catch blocks. a. exactly one b. zero or one c. zero or more d. one or more Question 12 Not yet answered Marked out of 200 If an exception is not handled by any catch or finally block, what will happen? a. The program will continue to the end of the current function, at which point the program will terminate. b. The program will immediately terminate. c. The exception is caught by a default exception handler. d. The exception is ignored. Question 13 Not yet answered Marked out of 200 Which of the following is NOT a capability associated with source code management systems? a. Enabling multiple users to simultaneously work on the same code project b. Tracking which user or users are responsible for which changes c. Tracking changes across multiple versions of a program d. Writing a UML diagram for a program Question 14 Not yet answered Marked out of 200 Suppose the following statement is true: Some xes are . Which of the following statements is most accurate? a. r should be implemented as a class method of x. b. y should be implemented as a class attribute of x. C. y should be implemented as a instance method of x. d. y should be implemented as a instance attribute of x. Question 15 Not yet answered Marked out of 200 Which of the following statements about method overriding are true? a. The methods involved have the same name, but different signatures. b. A method can only override methods defined in a superclass. c. A method can override a method defined in the same class. d. The methods involved have exactly the same signature. Question 16 Not yet answered Marked out of 200 Which of the following might be METHODS in a class Cat? a. My cat, Lily b. Playing with a ball of string c. Whether it is a boy cat or a girl cat d. Purring e. The color of its fur f. Atiger Quevtam 17 Nat yet ancwered Murked oet of 200 Assume that you want to define a public, non-static method getweeklyschedwle() that returns a 7 (each day of the week) by N (number of calendar events in a day) 2D array of calendarivents. Complete the definition for this method. pub1ic getweeklysichedule(). Question 18 Not yet antwered Muned oot of 200 The principle of "information hiding" is also known as Question 19 Not yer answered Murked ost of 2.00 The statement double phi =1.618; stores the actual value 1.618 in the memory address referred to as phi. . Select one. True False Qustaiph 20 Not yer ansaered Meries out of 2.00 Which of the following might be OBJECTS of a class Cat? a. Whether it is a boy cat or a girt cat b. Purring c. My cat Lily d. The color of its fur e. Playing with a ball of string f. A tiger Question 21 Not yet answered Marked out of 2.00 The class is used to process data from a file. a. String b. Fileinput c. Scanner d. Printwriter Question 22 Not yet answered Marked out of 2.00 Assume that the text file named testFle txt has the following two lines in it 1620 this is just a randon 11 ine of text. What will be the contents of str after the following snippet of code executes? file filetoopen = nes File("testfile,txt"); Scanner myfile = new Scanner(fileToopen); int nunber1 - myfile,nextint(); int number2 = myfile. nextint (); string line - myfile.nextline( ) a. This is just a random line of text b. The empty string c. This d. 20 e. 10 Question 23 Not yet answered Marked out of 2,00 The version control system we discussed in this subject is called Question 24 Not yet answered Marked out of 200 Which of the following would be valid examples of a class-object relationship? a. An object CSE4OOF of clasS LATROBE_SUBJECT b. An object WAFFLE of clasS SPACE SHIP c. An object BOAT of class YACHT d. An object VICTORIA of class MELBOURNE e. An object RUGBY of class SPORT f. An object FISH of class PET Question 25 Not yet answered Marked out of 200 Given the following Java code, what must be the name of the file that contains it? public class oofTest2e21 f pub1ic static void main(String[] acgs) ( System.out.println("Example"); ) ) Answe Question 26 Not yet answered Marked uet of 200 If the base type of an array is a object type, and we do NOT explicitly initialize its values, what happens? a. Each element of the array is automatically initialized to zero. b. A compiler error results. c. Each element of the array is automatically initialized to null. d. Compilation succeeds, but an exception is thrown at runtime. Question 27 Not yet anawered Marked out of 200 The so-called "for each" loop in Java is more flexible than a while loop. Select one: True False Question 28 Not yet answered Marked out of 2.00 In Java, an object can refer to itself as a. super b. self c. this d. ne Question 29 Not yet answered Marked out of 200 The boolean flag in the constructor of a filewriter object controls whether to the target file. a. Open or close b. write to in text or write to in binary c. write to or read from d. Overwrite or append to Question 1 Not yef answered Marked out of 2.00 An attribute declared as stat ic can only be modified by a method declared as stat ic Select one: True False Question 2 Not yef answered Manisd out of 2.00 Assume we have a Java class Music and some subclasses of Music: Jarx, Miphos, and kPop, each of which define a public method play(). We then have some code that defines an array of kusic objects, songs, and iterates over that array, for (Kusic song t songs) ( song-play() ). When song is an object of type Jazz, this code calls the . play() method defined in the Jazz class, and when it is an object of type xpop, this same code calls the .play() method defined in the kpop class. This is an example of a. abstraction b encapsulation c. information hiding d. polymorphism Quention 3 Nat yef answered Marked out of 2,60 Which of the following loop statements can be used to iterate over each line of a variable length file (for which a scanser object named infile has already been appropriately created)? a. while(1ntile,haskext ())() b. for (int i*a; i infile-length \{\};+1){} c. while(infile, getNextuine() {} d. for (String line ; infile) {} Questive 4 Not yet answered Marked out of 2.00 Which of the following are true statements about what happens if you attempt to create a new object of a ciass that does. not have a constructor defined? a. This is illegali an Exception is raised when the code reaches that line. b. Any numerio attribute in that object is initialized to be zero. c. Any object-type attribute in that object is initialized to be null. d. This is iliegal; an error occurs when you try to comple the program. e. Java generates a default constructor. f. Nothing, the new statement is ignored Questise 5 Nat yet answered Markes out of 200 A constructor can call another constructor in the same class, or another constructor in ins superclass, but not both. Select one: True False Questien 6 Nat yen anewered Marked out of 200 In object-oriented programming, classes are the in a description of a system. a. propositions b. nouns c. adjectives d. verbs Question 7 Not yet anseied Maried out of 2.90 s1. equals(s2); gives the same result as as s1 * s2. Select one: True False question 8 Not pet antwered Ltsied out of 260 Suppose the following statement is true: All xes are y. Which of the following statements is most accurate? a. r should be implemented as a class attribute of x. b. Y should be implemented as a instance attribute of x. c. should be implemented as a class method of x d. y should be implemented as a instance method of x. Quistlos 9 Not yet untwered Marked out of 2.60 The special method that is called when a new instance of a class is to be created is calied a Question 10 For yet antwed Maried out of 200 Two objects of the same class have the same STATE. a. can, and usually do b. can, but normally don't c. must not d. must

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Differentiate tan(7x+9x-2.5)

Answered: 1 week ago

Question

Explain the sources of recruitment.

Answered: 1 week ago

Question

Differentiate sin(5x+2)

Answered: 1 week ago

Question

Compute the derivative f(x)=1/ax+bx

Answered: 1 week ago