Docsity

Java Programming: Reading Assignment for September 8, 2004 - Prof. Mary Califf, Assignments of Information Technology

Toggle sidebar
bg1
ITK 168
Califf
Fall, 2004
Reading Assignment for September 8, 2004
Lewis and Loftus, 3.1-3.4
1. What operator does Java use to create an object? When and how can you avoid
using the operator to create a String object?
2. Assume that you have two int variables, num1 and num2, and two String
variables, str1 and str2. What is the difference between the two following
statements?
num1 = num2;
str1 = str2;
3. Write a statement to convert the string stored in str1 to all caps and store the
result in str2.
4. Write code to generate a random number between 1 and 20. Declare and initialize
all needed variables.

Partial preview of the text

Download Java Programming: Reading Assignment for September 8, 2004 - Prof. Mary Califf and more Assignments Information Technology in PDF only on Docsity!

ITK 168

Califf Fall, 2004 Reading Assignment for September 8, 2004 Lewis and Loftus, 3.1-3.

  1. What operator does Java use to create an object? When and how can you avoid using the operator to create a String object?
  2. Assume that you have two int variables, num1 and num2, and two String variables, str1 and str2. What is the difference between the two following statements? num1 = num2; str1 = str2;
  3. Write a statement to convert the string stored in str1 to all caps and store the result in str2.
  4. Write code to generate a random number between 1 and 20. Declare and initialize all needed variables.