Given the definition of the Vehicle class:
class Vehicle {
String name;
void setName (String name) {
this.name = name;
}
String getName() {
return name;
}
}
Which action encapsulates the Vehicle class?
A.
Make the Vehicle class public.
B.
Make the name variable public.
C.
Make the setName method public.
D.
Make the name variable private.
E.
Make the setName method private.
F.
Make the getName method private.
D
D
D. is correct
D