
Java Methods Test Review
Authored by Wendy Dyer
Computers
KG - University
Used 66+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
23 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
public class Dog {
public void speak() { System.out.println("whoof"); } }
//code in the main of another class Dog pup = new Dog(); pup.speak();
pup.speak();
pup.speak();
What is the Output?
whoofwhoofwhoof
whoof
whoof
whoof
whoof
whoof
speakspeakspeak
speak
whoof
whoof
whoof
whoof
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
public class Cat {
public void speak() { System.out.println("meow"); }
public void sayName() { System.out.println("kitty"); }
}
//code in the main of another class Cat kit = new Cat();
kit.sayName();
kit.speak();
kit.speak();
kit.sayName();
What is the output?
kittymeowmeow
meow
meow
kitty
meow
kitty
kitty
meow
meow
kitty
meow
meow
kitty
kitty
meow
meow
meow
meow
meow
meow
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
char cOne = 'a';
int iOne = 500;
double dOne = 100.5;
iOne = cOne+2; System.out.println(iOne);
What is the output?
97
98
99
100
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
char cOne = 'a';
int iOne = 500;
double dOne = 100.5;
iOne=iOne/2; System.out.println(iOne);
200
250.0
350
250
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
char cOne = 'a';
int iOne = 500;
double dOne = 100.5;
dOne=dOne+10; System.out.println(dOne);
101.5
110.0
110.5
110
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
char cOne = 'a';
int iOne = 500;
double dOne = 100.5;
iOne=cOne+5; System.out.println(iOne);
102
101
97
65
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
char cOne = 'a';
int iOne = 500;
double dOne = 100.5;
dOne=dOne/2; System.out.println(dOne);
50
25
50.25
50.5
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?