Q&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 AnswerI want knowledge
0 Votes
6 AnswersHot today
App Development
1 Votes
GUI-Based Python code in Webpage
3 Votes
Convert Animated SVG to PNG
1 Votes
My Missing Courses
1 Votes
cyber security
0 Votes
Number addition
0 Votes
Are '\0' and NULL the same?
1 Votes