JAVA final

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

To create a file, you can use

All of the above

Explain how to invoke a superclass method from a subclass method for the case in which the subclass method overrides a superclass method and the case in which the subclass method does not override a superclass method

In the case where the subclass method overrides the superclass method, it is necessary to explicitly use the keyword super to invoke the method of the superclass. When the subclass method does not override the superclass method, the superclass method can be invoked simply by using its name and appropriate arguments

The relationship between an interface and the class that implements it is

Inheritance

How does inheritance promote software reusability

Inheritance enables programmers to create new classes from existing classes by absorbing their attributes and behaviors, and adding capabilities the new classes require. Inheritance also takes advantage of class relationships where objects of a certain class have the same characteristics.

Describe the concept of polymorphism

Polymorphism makes it possible to design and implement systems that are more easily extensible. Programs can be written to process objects generically as one type and new classes can be added with little or no modifications to the generic part of the program. For example, a program can be designed to draw shapes rather than to draw rectangles, ovals and lines. Each shape object would know how to draw itself.

Which class do you use to write data into a text file

Printwriter

an instance of _____ describes programming errors such as bad casting, accessing an out of bounds array, and numeric errors

RuntimeException

Explain protected member access

The protected members of a class are accessible to the class in which they are defined, all subclasses of that class and other classes that are part of the same package.

which of the following statements is false

a method with no visibility modifier can be accessed by a class in a different package

in OOP, you declare a data fields to be private. This is called

encapsulation

To add two nodes node1 and node2 into a pane, use

pane.getChildren().addAll(node1, node2);

what modifier should you use on the members of a class so that they are not accessible to another class in a different package, but are accessible to any subclasses in any package?

protected

which of the methods is not defined in the Animation class

resume()

All methods in an interface are abstract

true

Closing a PrintWriter object ensures that the data in the buffer are sent to the file

true

Closing an OutputStream ensures that the data in the buffer are sent to the destination

true


Kaugnay na mga set ng pag-aaral

Circulatory Review Anatomy Final

View Set

Statistics, test #2 - stats and methods - ch. 3 & 4

View Set

Chapter 14: Care of the Patient with a Neurologic Disorder

View Set

Help Menu Core 1 (220-1001) Post-Assessment Quiz

View Set

Chapter 2- Outside- USA Strategic Planning

View Set

True/False Question On Financial Statement

View Set

Chapter 8: Skin Integrity and Wound Care

View Set