Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Questions about Java interface and abstract Question1 Which of the following statements tests for CONTENT equality? if ( x == Hello ) { ... }

Questions about Java interface and abstract

Question1

Which of the following statements tests for CONTENT equality?

if ( x == "Hello" ) { ... }
if ( x.equals( "Hello" ) ) { ... }
if ( x != "Hello" ) { ... }
if ( x.contains( "Hello" ) ) { ... }
None of the above

Flag this Question

Question 2

Which comparison below is acceptable in Java syntax if the following declarations are made? CSC142Point p1 = new CSC142Point( 3, 4 ); CSC142Point p2 = new CSC142Point( 5, 6 );

p1.getX() > p2.getX()
p1.setX(5) == p2.setX(5)
p1 < p2
all of the above
none of the first 3 are acceptable syntax in Java

Flag this Question

Question 3

Which of the following statements creates a composition (or aggregation) relationship?

public doSomething(Boo b){ ...}
return new Boo();
if ( myThing == b ) { ... }
private Boo myThing;
Boo Hoo

Flag this Question

Question 4

Which of the following things may an abstract class contain in addition to abstract methods?

method definitions with implementations
instance variable declarations
constructor definitions with implementations
class constants (final variables)
All of the above.

Flag this Question

Question 5

What is the difference between an abstract class and a concrete class?

An abstract class may NOT be extended.
An abstract class may NOT be instantiated.
All methods in an abstract class must be abstract.
A reference variable cannot have an abstract class as its static type.
All of the above.

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

Database Internals A Deep Dive Into How Distributed Data Systems Work

Authors: Alex Petrov

1st Edition

1492040347, 978-1492040347

More Books

Students also viewed these Databases questions

Question

Recognize and discuss the causes of culture shock

Answered: 1 week ago