Question

QUESTION 4 is true? C a. An interface rnay contan abstract mee ods and concrete methods. b.An abstract class may not contain
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solutions :

Q 4) True or False

Answer : True Option is 'C' - A class may implement more than one interface.

Explanation : In java programming, the java class can inherits only one parent class. and also multiple inheritance is not allowed in java so we can achieve multiple inheritance through interfaces and interfaces are not classes. so finally a class can implements multiple interfaces and the interfaces are declared by comma separated list .

Q 5) Which of the following option is true about first pass of the Quick Sort.

Answer : The first pass divides the list into two parts and sort the first pass.

Explanation : In quick sort, it uses divide and conquer strategy. quick sort select last element as pivot element and all the left elements are less than pivot and all the right elements are greater that pivot. quick sort selects the pivot element and call for partitioning and re-arranging the array in such a way that the pivot element placed in its final position. so the two parts created that is left elements from pivot is one part and right elements from pivot is second part. and same process is happens again until all the elements sorts in ascending order.

Add a comment
Know the answer?
Add Answer to:
QUESTION 4 is true? C a. An interface rnay contan abstract mee ods and concrete methods....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Question 60.1 pts Which of the following is true about a concrete class? A concrete class...

    Question 60.1 pts Which of the following is true about a concrete class? A concrete class may be extended. A concrete class may be instantiated. A concrete may NOT contain abstract methods. All of the above. None of the above. Flag this Question Question 70.1 pts Which of the following is true? A class extends exactly one other class and may implement any number of interfaces. A class may extend at most one concrete class, may extend any number of...

  • #1) If a concrete (non-abstract class is using an interface, it must do which of the...

    #1) If a concrete (non-abstract class is using an interface, it must do which of the following? contain the same methods as the interface inherit the properties of the interface create an interface object all of the above #2) Can multiple catch blocks be executed for a single try statement? Yes No #3) Which of the following is the default access specifier of a class member variable? Private Public Protected Internal #4) Which of the following keyword is used for...

  • Which of the following is true about interfaces: An interface can have only non abstract methods....

    Which of the following is true about interfaces: An interface can have only non abstract methods. All methods in an interface must be abstract. A class can only implement one interface. None of the items listed. Can not contain constants but can have variables. What is the rule for a super reference in a constructor? It must be in the parent class' constructor. You cannot use super in a constructor. It must be the last line of the constructor in...

  • Part I: Create a doubly linked circular list class named LinkedItemList that implements the following interface:...

    Part I: Create a doubly linked circular list class named LinkedItemList that implements the following interface: /** * An ordered list of items. */ public interface ItemList<E> {      /**       * Append an item to the end of the list       *       * @param item – item to be appended       */ public void append(E item);      /**       * Insert an item at a specified index position       *       * @param item – item to be...

  • I need help with the Implementation of an Ordered List (Template Files) public interface Ordered...

    I need help with the Implementation of an Ordered List (Template Files) public interface OrderedStructure { public abstract int size(); public abstract boolean add( Comparable obj ) throws IllegalArgumentException; public abstract Object get( int pos ) throws IndexOutOfBoundsException; public abstract void remove( int pos ) throws IndexOutOfBoundsException; public abstract void merge( OrderedList other ); } import java.util.NoSuchElementException; public class OrderedList implements OrderedStructure { // Implementation of the doubly linked nodes (nested-class) private static class Node { private Comparable value; private...

  • its about in C++ You will implement a simple calendar application The implementation should include a class named Calendar, an abstract class named Event and two concrete classes named Task an...

    its about in C++ You will implement a simple calendar application The implementation should include a class named Calendar, an abstract class named Event and two concrete classes named Task and Appointment which inherit from the Event class The Event Class This will be an abstract class. It will have four private integer members called year, month, day and hour which designate the time of the event It should also have an integer member called id which should be a...

  • //*Manager.java*// public interface Manager { public void handleCrisis(); } _________________________________________________________ /**Employee.java**/ Public abstract class Employee {...

    //*Manager.java*// public interface Manager { public void handleCrisis(); } _________________________________________________________ /**Employee.java**/ Public abstract class Employee { protected final String name; protected final int id; public Employee(String empName, int empId) { name = empName; id = empId; } public Employee() { name = generatedNames[lastGeneratedId]; id = lastGeneratedId++; } public String getName() { return name; } public int getId() { return id; } //returns true if work was successful. otherwise returns false (crisis) public abstract boolean work(); public String toString() { return...

  • Interfaces 1. What is inside an interface definition? What does a class do to an interface...

    Interfaces 1. What is inside an interface definition? What does a class do to an interface and what keyword is involved? How does a class do this to an interface (what should we find in the class)? Can an interface have a generic parameter? How do you instantiate an interface as an object? What methods can’t you use on an interface type? Abstract Data Types 2. What does an ADT define? Does an ADT specify programming language and/or data structures...

  • Registry Java Programming 2) Interface Comparator: The method for comparing two objects is written outside of...

    Registry Java Programming 2) Interface Comparator: The method for comparing two objects is written outside of the class of the objects to be sorted. Several methods can be written for comparing the objects according to different criteria. Specifically, write three classes, DescriptionComparator, FirstOccComparator, and LastOccComparator that implement the interface java.util.Comparator. DescriptionComparator implements the interface Comparator. The method compare compares the description of two objects. It returns a negative value if the description of the first object comes before the description...

  • Lab 2 (ADTs) 1) LockADT – Show the interface and all abstract methods LockDataStructureClass – Show the following methods: default constructor, overloaded constructor, copy constructor, setX, setY, s...

    Lab 2 (ADTs) 1) LockADT – Show the interface and all abstract methods LockDataStructureClass – Show the following methods: default constructor, overloaded constructor, copy constructor, setX, setY, setZ, alter (change the lock’s combination to the numbers passed) turn (use for loops to show the dial turning), close (locks the lock), attempt (tries to unlock the lock – calls turn( ), inquire (locked or unlocked), current (returns the number the dial is pointing to), toString LockClientDemoClass – You should have a...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT