Using Classes

Using Classes

Assessment

Flashcard

Computers

12th Grade

Practice Problem

Hard

Created by

Jeffrey Smith

FREE Resource

Student preview

quiz-placeholder

9 questions

Show all answers

1.

FLASHCARD QUESTION

Front

Shoes shoe1 = new Shoes();

Back

public Shoes(){

brand = "Nike"

size = 7;

}

2.

FLASHCARD QUESTION

Front

Shoes shoe2 = new Shoes("Adidas");

Back

public Shoes(String brand){

this.brand = brand;

size = 7;

}

3.

FLASHCARD QUESTION

Front

Shoes shoe1 = new Shoes(){

System.out.println(shoe1);

Ouput: Brand: Nike Size: 7

Back

public String toString(){

return "Brand: " + brand + " Size: " + size;

}

4.

FLASHCARD QUESTION

Front

System.out.println(shoes1.getBrand());

Back

public String getBrand(){

return name;

}

5.

FLASHCARD QUESTION

Front

shoes1.setSize(10);

Back

public void setSize(int size){

this.size = size;

}

6.

FLASHCARD QUESTION

Front

shoes1.setBrand("Puma");

Back

public void setBrand(String brand){

this.brand = brand;

}

7.

FLASHCARD QUESTION

Front

System.out.println(shoes1.getSize());

Back

public int getSize(){

return size;

}

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?