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 AnswersWhat does __init__ mean?
0 Votes
5 Answerswhy won't this code run
0 Votes
2 Answersadvanced classes
0 Votes
1 AnswerI was playing in the code playground after learning about the String.Concat in the static classes course. I have the following code, and was wondering if it's possible to put a period and space between the two texts, and how to put the second text on the next line.
http://www.sololearn.com/app/csharp/playground/c0rAVF6X3KwP/
-1 Vote
4 AnswersWhat is class?
0 Votes
4 Answersincrement operator
3 Votes
7 Answerswhy we use classes in Java?
0 Votes
3 AnswersLost in classmethod
1 Vote
3 AnswersWhich class to use?
1 Vote
3 AnswersWhile prototyping friend functions in a class is it necessary to always pass the address of the object as parameter?If so why is it that we have to pass address as parameter..In programs involving compositions we never used addresses...Why is the need for address of the objects while using friend?
4 Votes
1 AnswerHot today
3 consecutive words
1 Votes
c++ help
1 Votes
BOTSS
0 Votes
Access deny problem
2 Votes
How to insert a link into code
0 Votes
A small question
0 Votes
What's wrong with my code?
0 Votes
My future
0 Votes
How to complete
1 Votes