Question

In: Computer Science

To improve the overall functionality and efficiency of your sub-ordering Java application, you are considering the...

To improve the overall functionality and efficiency of your sub-ordering Java application, you are considering the use of some of the Java predefined methods. Some of the predefined Java classes and methods you are evaluating include vectors, wrapper classes, conversion methods, and collections data structures to process lists. Within the Discussion Board area, write 5 paragraphs that respond to the following questions with your thoughts, ideas, and comments. This will be the foundation for future discussions by your classmates. Be substantive and clear, and use examples to reinforce your ideas:

Thoroughly describe how you would utilize each of the following 4 topic areas to enhance the implementation of your Java sub-ordering application:

Vector class and methods (in terms of queue and stack creation and manipulation)

Wrapper classes (primitive)

Conversion methods (various string conversions)

Collections data structures (to build link list, queue, stack, search, and sort)

Solutions

Expert Solution

Dear Student, I have spent lot of time to make these terms short and clean, so if you got something from it, then give it an upvote. Thank you.

Q1) Vector class and methods

Ans: Vector is like the dynamic array which can grow or shrink its size. Unlike array, we can store n-number of elements in it as there is no size limit.

Java Vector class Declaration

public class Vector<E>
extends AbstractList<E>
implements List<E>, RandomAccess, Cloneable, Serializable

The Vector class implements a growable array of objects. Like an array, it contains components that can be accessed using an integer index. However, the size of a Vector can grow or shrink as needed to accommodate adding and removing items after the Vector has been created.

* The underlying structure for a stack could be an array, a vector, an ArrayList, a linked list, or any other collection. Regardless of the type of the underlying data structure, a Stack must implement the same functionality.

* It is very common to use a one-dimensional array as the representattion of a stack (vector representation) --> the item at the bottom of the stack is stored in the first array element, the stack item second to the bottom is stored in the second array element, etc.

* It is very common to use a one-dimensional array as the representattion of a queue (vector representation), the major shortcoming of the vector implementation is that queues must be limited in size. An alternative that eliminates this restriction is representing a queue as a linked list.

Q2) Wrapper classes

Ans: Wrapper classes provide a way to use primitive data types like int, boolean, Float, etc as objects.

When we create an object to a wrapper class, it contains a field and in this field, we can store primitive data types. In other words, we can wrap a primitive value into a wrapper class object.

To enhance the implementation of your Java code can be made easy by wrapper class, which deals with serialization, synchronization which includes collection framework like ArrayList, LinkedList, Vector, etc.

Q3) Conversion methods (various string conversions)

Ans: Conversion method in which string conversions are very important in java to enhance the implementation of Java application.

Various string conversions include:

1. Convert using Integer.toString(int)
The Integer class has a static method that returns a String object.
2. Convert using String.valueOf(int)
3. Convert using Integer(int).toString()
This methods used to invoke it’s toString method.
4.Convert using DecimalFormat
It is a class that formats a number to a String.
5. Convert using StringBuffer or StringBuilder
it is used to concatenate multiple values into a String.
6. Convert with special radix

Q4) Collections data structures (to build link list, queue, stack, search, and sort)

Ans: A Collection represents a single unit of objects like group

here the list Interface extends the collection framework which is a child interface of the collection interface. This interface is dedicated to the data of the list type in which we can store all the ordered collection of the objects. This is a child interface of the collection interface. This interface is dedicated to the data of the list type in which we can store all the ordered collection of the objects.

syntax:

List <data-type> list1= new ArrayList();  
List <data-type> list2 = new LinkedList();  
List <data-type> list3 = new Vector();  
List <data-type> list4 = new Stack();  

here stacks and queues are special cases of the idea of a collection.


Related Solutions

How an accounting information system like QuickBook can improve overall efficiency and effectiveness for an organization?
How an accounting information system like QuickBook can improve overall efficiency and effectiveness for an organization?
You are considering an investment in a new sub-industry of interest to your firm. The project...
You are considering an investment in a new sub-industry of interest to your firm. The project requires an initial outlay of $200,000. In addition, after-tax cash flows for years one through six will be $25,000 per year. The appropriate discount rate for this project is 12 percent. Your firm is not interested to continue with this project after the 6thyear, therefore, at the end of the project’s life, the firm is expected to liquidated this project and receive an addition...
CCC Shop is considering a project to improve their production efficiency. They are trying to decide...
CCC Shop is considering a project to improve their production efficiency. They are trying to decide whether it is a good idea or not to buy an automated injection molding machine which will result in reducing pre-tax costs by $500,000 for each of the next three years. The molding machine will cost $1,000,000 and the IRS says it must be depreciated as 3-year MACRS equipment. CCC Shop believes they can sell the machine for $80,000 at the end of three...
What can you do personally to improve your overall health? (1 page) thank you.
What can you do personally to improve your overall health? (1 page) thank you.
Web Server Infrastructure Web application infrastructure includes sub-components and external applications that provide efficiency, scalability, reliability,...
Web Server Infrastructure Web application infrastructure includes sub-components and external applications that provide efficiency, scalability, reliability, robustness, and most critically, security. The same advancements made in web applications that provide users these conveniences are the same components that criminal hackers use to exploit them. Prudent security administrators need to be aware of how to harden such systems. Use the graphic below to answer the following questions: Stage 1 Stage 2 Stage 3 Stage 4 Stage 5 Client Firewall Web Server...
Starset Machine Shop is considering a 4-year project to improve its production efficiency.
Starset Machine Shop is considering a 4-year project to improve its production efficiency. Buying a new machine press for $405,000 is estimated to result in $157,000 in annual pretax cost savings. The press falls in the 5-year MACRS class, and it will have a salvage value at the end of the project of $57,000. The press also requires an initial investment in spare parts inventory of $24,000, along with an additional $3,300 in inventory for each succeeding year of the...
using Java Your mission in this exercise is to implement a very simple Java painting application....
using Java Your mission in this exercise is to implement a very simple Java painting application. Rapid Prototyping The JFrame is an example that can support the following functions: 1. Draw curves, specified by a mouse drag. 2. Draw filled rectangles or ovals, specified by a mouse drag (don't worry about dynamically drawing the shape during the drag - just draw the final shape indicated). 3. Shape selection (line, rectangle or oval) selected by a combo box OR menu. 4....
How might the application of finance improve your professional and personal decisions?
How might the application of finance improve your professional and personal decisions?
Using Ruby Your extended Text Based Music Application must add the following functionality: Display a menu...
Using Ruby Your extended Text Based Music Application must add the following functionality: Display a menu that offers the user the following options: 1. Read in Albums 2. Display Albums 3. Select an Album to play 4. Update an existing Album 5. Exit the application Menu option 1 should prompt the user to enter a filename of a file that contains the following information: ·The number of albums ·The first album name ·The first artist name ·The genre of the...
For the second phase of your final project, you will provide the functionality to your command...
For the second phase of your final project, you will provide the functionality to your command interpreter. In this phase, you will add the functionality for command recognition and implement the HELP, QUIT, COPY, LIST, CD, SHOW and RUN functions. Recall that some commands have no arguments, some have one and some have two and so your interface must handle a variable number of parameters. Your command interpreter should do the following. Display a prompt for the user. Read the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT