i have this homework... i'm using a switch to offer some options for some sorting methods like bubbleSort, heapSort and some of them...
what i want to do is that instead of writing the bubbleSort code in the case, just pull it from where it is... i don't know how this is called, but you do it, it wouldn't be in the same file, just in the same folder... i don't know how it's done, but i know it can be done... like when you use TextIO, it's not in the same file, but's in the same folder... how can i do this?? can anyone help??:)

The bubble sort would have to be in its own class(or file as you refer to it) in order for you to do this. You have to then create an object of the bubble sort class and pass in the values to be sorted. So your bubble sort class has to be setup in such a way that it takes in unsorted values from other classes. This is a crucial concept of object oriented programing. Check out your text or try http://java.sun.com/docs/books/tutorial/java/concepts/

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.