Given the definition of the Vehicle class:
Class Vehicle {
int distance;
Vehicle (int x) {
this distance = x;
}
public void increSpeed(int time) {
int timeTravel = time; //line n1
//line n3
class Car {
int value = 0;
public void speed () {
value = distance /timeTravel; //line n2
System.out.println ("Velocity with new speed"+value+"kmph");
}
}
speed(); //line n3
}
}
and this code fragment:
Vehicle v = new Vehicle (100);
v.increSpeed(60);
What is the result?
asdfjhfgjuaDCV
5 months agosteefaand
5 months, 4 weeks agovleunti
9 months, 3 weeks agosandoro
1 year agor1muka5
1 year, 5 months agoMR_JAVA
1 year, 5 months agoJonanien
1 year, 9 months agoKyle_XY
2 years, 3 months agoHanenBA
2 years, 5 months agoYasinGaber
2 years, 5 months agoMinks
2 years, 10 months agoSvetleto13
3 years, 2 months agoSvetleto13
3 years, 2 months agomeyow
3 years, 3 months agomaslac
3 years, 4 months agoMilkBiscuit
3 years, 7 months agovarconite
3 years, 8 months ago