Also it should be noted that I dont want the last number (mega number) in order, this one will always be placed last.

import java.util.Scanner; import java.util.Random; public class SuperLotto { private Scanner input = new Scanner( System.in ); private Random randomNumbers = new Random(); public int selectTickets() { int tickets = input.nextInt(); return tickets; } //end seletTickets public void generateNumbers( int tickets, int[] array) { for( int ticket = 0; ticket < tickets; ticket++ ) { System.out.print( "\n****************\n" ); for( int lottonumbers = 0; lottonumbers < 5; lottonumbers++ ) { array[lottonumbers] = 1 + randomNumbers.nextInt(47); } //end inner for for( int numbers = 0; numbers < 5; numbers++ ) { int temp; if ( array[numbers] > array[numbers + 1] ) { temp = array[numbers]; array[numbers] = array [numbers + 1]; array[numbers + 1] = temp; } System.out.printf( "%d ", array[numbers]); } int mega = 1 + randomNumbers.nextInt(27); System.out.printf( "%d ", mega ); array[5] = mega; } //end outer for System.out.print( "\n****************\n" ); } //end generateNumbers public static void main( String args[] ) { int tickets = 1; int array[] = new int[6]; SuperLotto game = new SuperLotto(); System.out.print( "Welcome to SuperLotto\nEnter desired amount of tickets: " ); tickets = game.selectTickets(); game.generateNumbers( tickets, array ); System.out.print( "Thank You For Playing\n" ); } //end main } //end public SuperLotto