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
20 questions
JDBC

Quiz
•
University
20 questions
Day 10 - ONLINE TEST - PL03 PYTHON PROGRAMMING

Quiz
•
University
20 questions
Mastering Java Concepts

Quiz
•
University
15 questions
Python

Quiz
•
6th Grade - University
19 questions
Java Basic 1 - Quiz

Quiz
•
8th Grade - University
20 questions
Code Junction 4

Quiz
•
University
15 questions
JavaScript Basics

Quiz
•
12th Grade - University
20 questions
OOP

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

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

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University