Start of Tutorial > Start of Trail > Start of Lesson |
Search
Feedback Form |
- Which of the following are valid variable names?
int anInt i i1 1 thing1 1thing ONE-HUNDRED ONE_HUNDRED something2do- Answer the following questions about the
BasicsDemo
program.
- What is the name of each variable declared in the program? Remember that method parameters are also variables.
- What is the data type of each variable?
- What is the scope of each variable?
Check your answers.
- Modify the
MaxVariablesDemo
program so thataBoolean
has a different value.- Rewrite the
MaxVariablesDemo
program to display the minimum value of each integer data type. You can guess what the names of these variables are or you can look them up in the API documentation.- Can you guess the name of a method in the
Character
class that you can use instead ofisUpperCase
to determine the capitalization of a character? Modify theMaxVariablesDemo
program to use that method instead ofisUpperCase
.
Start of Tutorial > Start of Trail > Start of Lesson |
Search
Feedback Form |
Copyright 1995-2004 Sun Microsystems, Inc. All rights reserved.