Posted by **gaurav** on Sunday, October 16, 2011 at 8:03pm.

i have two numbers...

1564656

1981676

i want to check if the first and the last number from a string of these numbers are the same or not...how would i do that. how would i just compare the first and a last number and ignore the other numbers in this string?

my code so far...

class lotto

{

public static void main(String[] args)

{

JOptionPane.showMessageDialog (null, " LOTTOMAX - PLAY - WIN");

String numgen =JOptionPane.showInputDialog (null, " ENTER 7 DIGIT NUMBER:" );

int playa1 = Integer.parseInt(numgen);

JOptionPane.showMessageDialog (null, playa1);

int LottoRandom = (int)(Math.random()*10000000);

JOptionPane.showMessageDialog (null, LottoRandom);

if (playa1 >10000000 )

{

JOptionPane.showMessageDialog (null, " INVALID NUMBER. ");

}

## Answer This Question

## Related Questions

- College Algebra - The sum of two numbers is less than 12. The second number is 8...
- math word problems - The sum of two numbers is 69. The second is 9 more than 4 ...
- math - the binary system is used for computer programming. a binary number ...
- Algebra - Four numbers have a total of 92. The first number is twice the second ...
- Computer - devise a number system based on base 11. a)draw the number line b)...
- Math - When factoring a trinomial that is in the format Ax^2 + Bx + C, the ...
- Grade 8 Math - Can you write them in Mathematical/numbers form I'll solve them ...
- algebra - true or false 1. fraction cant be written as decimal. 2. natural ...
- algebra - find five numbers with a mean of 16, a median of 15 a mode of 21 and a...
- algebra - One number is 4 times another. If the sum of their reciprocals is 5/36...

More Related Questions