AP Computer Science A: Unit 2 Exam Fundamentals of Java
AP Computer Science A: Unit 2 Exam Fundamentals of Java Consider the following variable declarations. int a = 5; int b = 4; double x = 5; double y = 4; Which of the following expressions would evaluate to the number, 1? 1. (int) x / y 2. a / b 3. a % b - Answer>> All of them. (1 , 2, and 3) Consider the following variable declarations. 1. double x = (int) 3.4 2. int y = (int) 5 / 2 , 5 3. String z = new String(" ") - Answer>> 1 and 3 Consider String a below. Which of the following would create a new String with the value, "ram"? String a = new String ("Java Program"); - Answer>> String b = ring(9);
Written for
- Institution
- Ap computer Science
- Course
- Ap computer Science
Document information
- Uploaded on
- April 19, 2024
- Number of pages
- 6
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
Also available in package deal