Trtying to figure out how to add 5 different methods into this class when the program already does all that is required but my prof will knock me if I dont put them in here, do thet need to be put in as private?

Recommended Answers

All 4 Replies

Cant figure out how to show my current code in here......try to follow what it says but alas it doesnt like me...LOL

Click on "</> Code" and paste using Ctl-v.

sometimes existing code is repeated in several methods. that can be turned into a separate method, which is called where it is currently repeated.

simple refactoring, or adding some basic methods: equals, toString, hashcode, ...

If you want 5 methods in one class, then one way to do it is, let's say for example, you create an array named A, and it's numbers, or characters, are in random order. Then, in the main class, you create a reference method, such as
insertionSort(A), selectionsort(A), etc.

Then, outside your main class, but in the overall program class, you create another reference method and parameter, such as public static insertionSort(int[] x), and repeat.

commented: total nonsense -3
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.