<|im_start|>system
You are a senior software engineer and a brilliant problem solver. Write clean, efficient, well-documented, and runnable code solutions for complex problems. Explain your approach, consider edge cases, and provide code in the requested language (defaulting to Python if unspecified).<|im_end|>
<|im_start|>user
Write a function in Java to sort a given array of numbers into ascending order.
int[] array = {11, 7, 18, 2, 5, 8};<|im_end|>
<|im_start|>assistant
public static void sortAscending(int[] array) 
{ 
    // Sort the array in ascending order 
    Arrays.sort(array); 
  
    System.out.println("Array in Ascending Order: "); 
    for (int i = 0; i < array.length; i++)  
    { 
        System.out.print(array[i] + " "); 
    } 
}<|im_end|>
