I just need to know two things for my program to work. The first one is i have a user input and i need another method to use those numbers but im unsure how to do so. In my program its lower1 and upper1. The other is i need to print out the arrays element number not whats actually in the element for example in my case the elements are set to true and false. My problems basically have to deal with the last method in showSieve(). Heres my code

Code:import java.util.Scanner; public class test { public static int upper; public static int lower; public static boolean[] primes = new boolean[50001]; public static void main ( String args[] ) { initializeSeive(); processSieve(); getBoundaries(); showSieve(); } public void initializeSeive() // initializes the sieve. { int lower = 1; int upper = 50000; primes[0] = primes[1] = false; for (int i = 2; i < primes.length; i++) { primes[i] = true; } } public void processSieve() // run the Sieve algorithm { for(int i = 2; (i * i) <= 50000; i++ ) { for (int j = (i * i); j <= 50000; j = j + i) { primes[j] = false; } } } public static void getBoundaries() // get lower and upper boundaries { Scanner in = new Scanner ( System.in ); int lower1 = 0, upper1 = 0; do { do { System.out.print ( "Please enter the lower boundary (between 1 and 50000): " ); lower1 = in.nextInt(); } while ( ( lower1 < 1 ) || ( lower1 > 50000 ) ); do { System.out.print ( "Please enter the upper boundary (between 1 and 50000): " ); upper1 = in.nextInt(); } while ( ( upper1 < 1 ) || ( upper1 > 50000 ) ); if (lower1 > upper1) { System.out.println ( "Your upper boundary cannot be smaller than your lower boundary"); } } while ( lower1 > upper1 ); } public void showSieve() // now shows sexy pairs between lower and upper { System.out.printf ( "Here are all of the sexy prime pairs in the range %d to %d, one pair per line: \n", lower1, upper1 ); for (int i = lower1; i < upper1; i++) { if (primes[i] == true) { if (primes[i + 6] == true) { System.out.printf( "" + primes[i] + " and " + primes[i + 6] + "\n"); } } } } }