Java Objects - Real world Scenarios - Practice Quiz

Quiz
•
Computers
•
University
•
Hard
VIKAS BANDARU
Used 1+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Answer explanation
2.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Answer explanation
3.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Answer explanation
4.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Answer explanation
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Timer has field seconds (int). Constructor Timer(int s). Methods: addSeconds(int s) adds to seconds, tick() decreases seconds by 1 if seconds > 0 and returns current seconds. After: Timer t = new Timer(2); t.tick(); t.addSeconds(5); int x = t.tick();
What is x and final seconds?
Answer explanation
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
GeoPoint has x(double), y(double). Constructor GeoPoint(double x,double y). Method move(double dx,double dy) returns new GeoPoint with moved coordinates; translate(double dx,double dy) changes this and returns this. After: GeoPoint p = new GeoPoint(1,1); GeoPoint q = p.move(2,3); p.translate(1,-1);
What are p and q?
Answer explanation
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Message has text(String). Constructor Message(String t). Methods: append(String s) appends and returns this, clear() sets text to empty and returns void, length() returns int length.
After:
Message m = new Message("Hello"); m.append(" ").append("Java");
int n = m.length(); m.clear();
System.out.println(n + " " + m.length());
Answer explanation
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Bootcamp Day 3 - Java Array

Quiz
•
University
23 questions
Java Array

Quiz
•
University
20 questions
Java Coding Questions

Quiz
•
University
16 questions
Arithmetic Types Declare Initialize Relation Logical Ops

Quiz
•
9th Grade - University
18 questions
Java Programming Quiz

Quiz
•
University
18 questions
PBO Inheritance Episode 2

Quiz
•
University
15 questions
002_Java Methods

Quiz
•
12th Grade - University
25 questions
Java Review

Quiz
•
9th Grade - University
Popular Resources on Wayground
12 questions
Unit Zero lesson 2 cafeteria

Lesson
•
9th - 12th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
20 questions
Lab Safety and Equipment

Quiz
•
8th Grade
13 questions
25-26 Behavior Expectations Matrix

Quiz
•
9th - 12th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
15 questions
Let's Take a Poll...

Quiz
•
9th Grade - University
2 questions
Pronouncing Names Correctly

Quiz
•
University
12 questions
Civil War

Quiz
•
8th Grade - University
18 questions
Parent Functions

Quiz
•
9th Grade - University
21 questions
Mapa países hispanohablantes

Quiz
•
1st Grade - University
19 questions
Primary v. Secondary Sources

Quiz
•
6th Grade - University
25 questions
Identifying Parts of Speech

Quiz
•
8th Grade - University
20 questions
Disney Trivia

Quiz
•
University