Search Header Logo

Java Methods Test Review

Authored by Wendy Dyer

Computers

KG - University

Used 66+ times

Java Methods Test Review
AI

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
speakspeakspeak
speak
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
kitty
meow
meow
kitty
kitty
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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?