Algorithms, precise instructions on how to to accomplish a specific task, are at the core of computer science.
The idea of selection sort is:
In other words:
Methods in Java can be divided into two groups, based on whether they have the static
modifier or not.
Methods without the static
modifier are instance methods. Methods with the static
modifier are class methods
Instance methods are methods that are associated with an object, can process the objects variables and can call the object's other methods. Instance methods specifically CAN use the this
modifier, which refers to the variables associated with the specific object, that is calling the instance method.
Class methods can't use the this
modifier, meaning that they can only access the variables they are given as parameters or that they create themselves.
Arrays can be sorted (into their natural order) using the class method sort
of the Arrays
-class.