• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 14 pages
Exam (elaborations)

C212 Latest Exams Script Questions And Answers Sure A.pdf

Document preview thumbnail
Preview 2 out of 14 pages

C212 LATEST EXAMS SCRIPT QUESTIONS AND ANSWERS SURE A.pdf

Content preview

C212 LATEST EXAMS SCRIPT QUESTIONS AND
ANSWERS SURE A+
✔✔61. Define: keyboard events - ✔✔Keyboard events are used to process keystrokes,
such as the arrow keys. The KeyListener interface has three methods: keyPressed,
keyReleased, and keyTyped

✔✔62. Explain: the Character class has methods for classifying characters -
✔✔Character.isDigit(ch) returns true if ch is ('0'...'9')
.isLetter (A, B, C, a, b, c)
.isUpperCase (A, B, C)
.isLowerCase (a, b, c)
.isWhiteSpace (space, newline, tab)

✔✔63. How do you convert Strings to numbers in Java - ✔✔If a string contains the
digits of a number, you use the Integer.parseInt or Double.parseDouble method to
obtain the number value.

✔✔64. Suppose the input contains the characters Hello, world! What are the values of
world and input after this code fragment
String word = in.next();
String input = in.nextLine(); - ✔✔word is "Hello, " and input is "World!"

, ✔✔65. Your input file contains a sequence of numbers, but sometimes a value is not
available and is marked as N/A. How can you read the numbers and skip over the
markers? - ✔✔Read them as strings, and convert those strings to numbers that are not
equal to N/A:
String input = in.next();
if (!input.equals("N/A"))
{ double value = Double.parseDouble(input);
Process value. }

✔✔66. Define: command line arguments: - ✔✔If you start a Java program by typing the
name at the prompt in a command shell window, you "invoke the program from the
command line". When you use this method, you must type the name of the program, but
you can also type in additional information that the program can use. These additional
strings are called command line arguments.

✔✔67. Encrypt CAESAR using the Caesar cipher - ✔✔FDHVDU

✔✔68. When do you use the throw statement? - ✔✔To signal an exceptional condition,
use the throw statement to throw an exception object. When you throw an exception,
processing continues in an exception handler.

✔✔69. What is the catch clause used for? - ✔✔Each catch clause contains the handler
for an exception type. When you throw an exception, you can provide your own
message string.

✔✔70. What are checked exceptions? - ✔✔Checked exceptions are due to external
circumstances that the programmer cannot prevent. The compiler checks that your
program handles these exceptions.

✔✔71. When do you use the throws clause? - ✔✔The throws clause signals to the
caller of your method that it may encounter an exception. If your current method cannot
handle the exception, you tell the compiler that you are aware of the exception and that
you want your method to be terminated when it occurs. You supply the method with a
throws clause.

✔✔72. How (and why) do you design your own Exception types? - ✔✔Sometimes none
of the standard exception types describe your particular error condition well enough. In
that case, design your own Exception class.

✔✔73. Why is an ArrayIndexOutOfBoundsException not a checked exception? -
✔✔Because programmers should simply check that their array index values are valid
instead of trying to handle an ArrayIndexOutOfBoundsException.

Document information

Uploaded on
July 14, 2026
Number of pages
14
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$16.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
BOARDWALKer
3.4
(19)
Sold
162
Followers
6
Items
26749
Last sold
16 hours ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions