This is the result for me.

Code:

Welcome, new player! Let's play the guessing game!
Rules of the guessing game:
1. You've got 5 guesses to guess my secret number
2. The number is whole number that's between 0 and 15 (inclusive at both ends)
3. I'll give you hints about the number, if you don't guess right.
Ok, I just thought of a new number for you to guess.
So far, you've guessed:
You have 5 guesses left
Your next guess?
5
I'm sorry, but my secret number is not 5
My secret number is greater than 5
So far, you've guessed: 5
You have 4 guesses left
Your next guess?
3
I'm sorry, but my secret number is not 3
My secret number is greater than 3
So far, you've guessed: 5 3
You have 3 guesses left
Your next guess?
10
I'm sorry, but my secret number is not 10
My secret number is greater than 10
So far, you've guessed: 5 3 10
You have 2 guesses left
Your next guess?
34
I'm sorry, but my secret number is not 34
My secret number is smaller than 34
So far, you've guessed: 5 3 10 34
You have 1 guesses left
Your next guess?
1
I'm sorry, but my secret number is not 1
My secret number is greater than 1
So far, you've guessed: 5 3 10 34 1
You have no more guesses left
My secret number is: 15

can you give me code for keyBoard and randomgenerator you used in GuessingGame.

Also, there is no chance of getting run time error after "My secret number is smaller than 10" because we have one more system.out.println statement before doing anything.

Can you please compare the code I posted with what you copied? Sorry to say this..