New course! Every coder should learn Generative AI!
Try a free lessonQ&A Discussions
public class Vehicle {
int maxSpeed;
int wheels;
String color;
double fuelCapacity;
void horn() {
System.out.println("Beep!");
}
}
class MyClass {
public static void main(String[ ] args) {
Vehicle v1 = new Vehicle();
Vehicle v2 = new Vehicle();
v1.color = "red";
v2.horn();
System.out.println(v1);
}
}
Explain its outcome. I am unable to get the last line of outcome.
-1 Vote
2 Answers2 div one line
0 Votes
4 Answerswhat is line break up
0 Votes
6 Answersdef add(x, y):
return x + y
def do_twice(func, x, y):
return func(func(x, y), func(x, y))
a = 5
b = 10
print(do_twice(add, a, b))
Please explain step by step
Which is caller here?
Explain the 3rd and 4th line ?
why in 4th line we write add(add(x,y),add(x,y)) which is function of 1st line ?
how can we write function after return statement insted of (x+y+x+y )=30?
0 Votes
2 Answerswhat the line sum+= do?
2 Votes
4 AnswersHot today
Help
3 Votes
What did I do wrong ??
0 Votes
Quick question 🤔
1 Votes
Recursion
0 Votes
I need some help
1 Votes
debugging course
3 Votes
Test Case #5 Failed. Help.
0 Votes
Beginner
1 Votes