InputMisMatchException

hi guys i'm new in java and this site too
i was making a small program but this mismatchexception making me angry
i really appreciate if u answer my these stupid questions
1. what is token...
2. Exception in thread "main" java.util.InputMismatchException
at java.util.Scanner.nextInt(Unknown Source)[/TEX][/TEX][/TEX]
at java.util.Scanner.nextInt(Unknown Source)
at Main.check(Main.java:63)
at Main.doMain(Main.java:22)
at MiniCinwma.main(MiniCinwma.java:6)
From MiniCinema class

Main mini =new Main();
mini.doMain();// this is error line MiniCinwma.java:6

From then in doMain() i called check()
In check() method

B.displayTime();
System.out.println("You have to pay just " + B.getTimePrice(input.nextInt())+ " to enjoy this movie"); //here error comes line 63
B.ticket();

in above line i just get input of int type pass it to getTimePrice(int a){this method also accepting int} then way there is something like input[mismatchexception?
i'm really confuse.

1. Robert W. Sevesta (2002, Concepts of programming languages, 5th edition, page 107 ) pointed out that “ a token of a language is a category of its lexemes.”
“Formal descriptions of the syntax of programming languages, for simplicity’s sake, often do not include descriptions of the lowest-level syntactic units. These small units are called lexemes.”
2. When the class Scanner in java.util.* is used, you may create a instance:
Scanner in = new Scanner(System.in);
Then using the instance in :
int n = in.nextInt();
To receive an input in int.
When the input string is not a int string, e.g. “44k4”, an InputMissmatchException is thrown:
(see the thread” How to guard the input effectively”http://www.daniweb.com/forums/thread299076.html
);

/* The following program demonstrates how to guard
* a non-negative input in int.
* If the input is in int and also greater than -1, the valid input
* will be shown on DOS window and program terminates.
* If client inputs an value in non-int or an negative value in int, the program will
* ask the user for re-input.
**/
import java.util.*;
public class Input {
public static void main(String args[]){
int n=0;
Scanner in = new Scanner(System.in);
while(true){
try{
System.out.println("Input a non-negative integer:");
n = in.nextInt();
}catch(InputMismatchException e){
System.out.println("Your input is mismatched.");
in.next();
continue;
}
if (n<0){
System.out.println("You negative value is not valid.");
continue;
}
break;
}
System.out.printf("Your input is %d\n", n);
}
}

his int a =input.nextInt() not letting me to enter some thing just giving me error

What was entered before this point? Scanner will buffer/save what was input and try to give it to you on the nextXXXX call you make.

What code is around this line: at Block.displayTime(Block.java:26)

Can you run the program in the command prompt, copy and paste the screen contents here?
Click on Icon in upper left corner
Select Edit
Select 'Select All' - The selection will show
Click in upper left again
Select Edit and click 'Copy'

What was entered before this point? Scanner will buffer/save what was input and try to give it to you on the nextXXXX call you make.

What code is around this line: at Block.displayTime(Block.java:26)

Can you run the program in the command prompt, copy and paste the screen contents here?
Click on Icon in upper left corner
Select Edit
Select 'Select All' - The selection will show
Click in upper left again
Select Edit and click 'Copy'

What was entered before this point? Scanner will buffer/save what was input and try to give it to you on the nextXXXX call you make.

What code is around this line: at Block.displayTime(Block.java:26)

Can you run the program in the command prompt, copy and paste the screen contents here?
Click on Icon in upper left corner
Select Edit
Select 'Select All' - The selection will show
Click in upper left again
Select Edit and click 'Copy'

It would help if you posted exactly what was printed on the console and not edit it.
It took me a few minutes to understand what was happening.
If you had posted: aStr=System.in<
I would have known faster.

When using println() for debug tracing it is important to have a unique id string (aStr=) and to have a terminating character "<" so you can know where and what is being printed.

This is a program im writing for class.
Here is the exception im getting:
Exception in thread "main" java.lang.NullPointerException
at LinkedList_final.insert(LinkedList_final.java:72)
at LinkedList_final.main(LinkedList_final.java:247)
Basically, my …

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...