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
9 months, 4 weeks agosteefaand
10 months, 3 weeks agovleunti
1 year, 2 months agosandoro
1 year, 5 months agor1muka5
1 year, 10 months agoMR_JAVA
1 year, 10 months agoJonanien
2 years, 2 months agoKyle_XY
2 years, 8 months agoHanenBA
2 years, 10 months agoYasinGaber
2 years, 10 months agoMinks
3 years, 3 months agoSvetleto13
3 years, 7 months agoSvetleto13
3 years, 7 months agomeyow
3 years, 8 months agomaslac
3 years, 8 months agoMilkBiscuit
4 years agovarconite
4 years ago