Question

1.which of the following are methods of the JDK iterator interface? a) hasNext() b) next() c)...

1.which of the following are methods of the JDK iterator interface?

a) hasNext()

b) next()

c) both a and b

d) neither a nor b

2.what is the purpose of the static method named instance() in a singleton class

a) to create the only instance of the singleton class (if needed) and return it

b) To receive the only instance of the singleton class as a parameter and store it in the field of the class

c) To query the user for the singleton instance and store it in a field of the class

d) none of the above

3. Using the adaptee pattern helps

a) improve code reuse

b)Allow client code to remain unchanged when a collection changes

c) Overcome the drawbacks of the object oriented paradigm

d) avoid class explosion

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1)  c) both a and b
2)  a) to create the only instance of the singleton class (if needed) and return it
3)  b) Allow client code to remain unchanged when a collection changes
Add a comment
Know the answer?
Add Answer to:
1.which of the following are methods of the JDK iterator interface? a) hasNext() b) next() c)...
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
  • Step 1 Develop the following interface: Interface Name: Queue Interface<T> Access Modifier: public Methods Name: isEmpty...

    Step 1 Develop the following interface: Interface Name: Queue Interface<T> Access Modifier: public Methods Name: isEmpty Access modifier: public Parameters: none Return type: boolean Name: dequeue Access modifier: public Parameters: none Return type: T (parameterized type) Name: enqueue Access modifier: public Parameters: element (data type T, parameterized type) Return type: void Step 2 Develop the following class: Class Name: Queue Node<T> Access Modifier: public Instance variables Name: info Access modifier: private Data type: T (parameterized type) Name: link Access modifier:...

  • Step 1 Develop the following interface: Interface Name: QueueInterface<T> Access Modifier: public Methods Name: isEmpty Access...

    Step 1 Develop the following interface: Interface Name: QueueInterface<T> Access Modifier: public Methods Name: isEmpty Access modifier: public Parameters: none Return type: boolean Name: dequeue Access modifier: public Parameters: none Return type: T (parameterized type) Name: enqueue Access modifier: public Parameters: element (data type T, parameterized type) Return type: void Step 2 Develop the following class: Class Name: QueueNode<T> Access Modifier: public Instance variables Name: info Access modifier: private Data type: T (parameterized type) Name: link Access modifier: private Data...

  • Step 1 Develop the following interface: Interface Name: QueueInterface<T> Access Modifier: public Methods Name: isEmpty Access...

    Step 1 Develop the following interface: Interface Name: QueueInterface<T> Access Modifier: public Methods Name: isEmpty Access modifier: public Parameters: none Return type: boolean Name: dequeue Access modifier: public Parameters: none Return type: T (parameterized type) Name: enqueue Access modifier: public Parameters: element (data type T, parameterized type) Return type: void Step 2 Develop the following class: Class Name: QueueNode<T> Access Modifier: public Instance variables Name: info Access modifier: private Data type: T (parameterized type) Name: link Access modifier: private Data...

  • PLEASE DO IN JAVA 1) Create interface named “Person” which exposes getter/setter methods for the person’s...

    PLEASE DO IN JAVA 1) Create interface named “Person” which exposes getter/setter methods for the person’s name and college ID: 1. getName 2. setName 3. getID 4. setID. The college ID is represented as “int”. Define two classes, Student and Faculty, which implement Person. Add field GPA to Student and department to faculty. Make them private and create corresponding getters (getGPA, getDepartment) and setters (setGPA, setDepartment). Use appropriate types. 2) Write a class College, which contains the name of the...

  • The following is for java programming. the classes money date and array list are so I are are pre...

    The following is for java programming. the classes money date and array list are so I are are pre made to help with the coding so you can resuse them where applicable Question 3. (10 marks) Here are three incomplete Java classes that model students, staff, and faculty members at a university class Student [ private String lastName; private String firstName; private Address address; private String degreeProgram; private IDNumber studentNumber; // Constructors and methods omitted. class Staff private String lastName;...

  • I. User Interface Create a JavaFX application with a graphical user interface (GUI) based on the...

    I. User Interface Create a JavaFX application with a graphical user interface (GUI) based on the attached “GUI Mock-Up”. Write code to display each of the following screens in the GUI: A. A main screen, showing the following controls: • buttons for “Add”, “Modify”, “Delete”, “Search” for parts and products, and “Exit” • lists for parts and products • text boxes for searching for parts and products • title labels for parts, products, and the application title B. An add...

  • QUESTION 1 Match the following: an SQL command that retrieves data A. Communicate B. RETRIEVE C....

    QUESTION 1 Match the following: an SQL command that retrieves data A. Communicate B. RETRIEVE C. exception D. ReadFile E. STORE F. array G. try - catch block H. Connection I. Disconnect0) J. StreamReader K. Respond L. SQL M. Fork N. Query O. BlowUp P. SELECT Q. Close0 R. StreamWriter S. WriteFile T. UPDATE an SQL command that changes data ., class that can be used to read data from a file , establishing communication with a database a method...

  • Complete the following case study: Case study: Three implementations of contains - comparing approaches to adding...

    Complete the following case study: Case study: Three implementations of contains - comparing approaches to adding functionality Set A contains Set B if every element in Set B is also in Set A. We will compare three ways to determine whether Set A contains Set B. Approach 1: Write code in the main method in a test class Add code to the main of ArraySetTester to create SetA and SetB, fill them with data and write a contains operation that...

  • 1. What is output by the following code: ArrayList< Integer > a = new ArrayList< Integer...

    1. What is output by the following code: ArrayList< Integer > a = new ArrayList< Integer >(); ArrayList b = a; a.add(new Integer(4)); b.add(new Integer(5)); a.add(new Integer(6)); a.add(new Integer(7)); System.out.println(b.size()); A)1 B)2 C)3 D)4 E)5 2. Assume the Student and Employee classes each extend the Person class. The Student class overrides the getMoney method in the Person class. Consider the following code:     Person p1, p2, p3;     int m1, m2, m3;     p1 = new Person();     m1 = p1.getMoney();     // assignment 1...

  • Goals . Understand how to implement operator overloading in C++ Warning: Programs must compile us...

    c++ format Goals . Understand how to implement operator overloading in C++ Warning: Programs must compile using gt+ on the Computer Science Linux systems. If your code does not compile on CS machines you will get 0 for the assignment. Organize your files into folders by lab assignment. For this assignment, create a folder called Lab9. A. Read Chapter 18 B. Create a new class called RationalNumber to represent fractions. The class should have the following capabilities: 1) It should...

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
ADVERTISEMENT