I am writing code that opens notepad, but when I want to write an exclamation mark it throws an error; here is the code I am using to write the exclamation mark.
robot.keyPress(KeyEvent.VK_EXCLAMATION_MARK);
robot.keyRelease(KeyEvent.VK_EXCLAMATION_MARK);
Why is it giving me the error?