| String | 0 | 0x | -0xf | 0f | 0934 | +0xFABEL | 00X32 |
|---|---|---|---|---|---|---|---|
| Accept or Reject? |
Accept | Reject | Accept | Reject | Accept | Accept | Reject |
All of those strings are legal Java integer literals. The following Java program is correct, and will compile and run:
class WeirdInt
{
public static void main ( String[] args )
{
long i = +0xFABEL;
System.out.println("Weird Int:" + i);
}
}
Here is an automaton. But the transitions have not been labeled!
Label the transitions so that the automaton accepts strings of one or more a characters followed by one or more b characters.