F&A Diskussionen
Explain your experience using c++
0 Stimmen
1 Antwortpublic 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 Stimme
2 AntwortenOutput of C++ code
0 Stimmen
2 Antwortenurgent java
0 Stimmen
2 Antworten"time is not defined"?
2 Stimmen
1 AntwortConstructor Error
1 Stimme
2 AntwortenCan someone explain this code to me....
class ReverseNumberDemo
{ public static void main(String args[]) {
int num=123456789;
int reversenum =0;
while( num != 0 ) {
reversenum = reversenum * 10;
reversenum = reversenum + num%10;
num = num/10; }
System.out.println("Reverse of specified number is: "+reversenum);
}
}
the thing I don't get is the reversenum part......isn't reversenum=0 so wouldn't reversenum*10=0
0 Stimmen
8 Antwortencan anyone plz explain me this program step by step?#include <iostream>
using namespace std;
class MyClass {
public:
int var;
MyClass() { }
MyClass(int a)
: var(a) { }
MyClass operator+(MyClass &obj) {
MyClass res;
res.var= this->var+obj.var;
return res;
}
};
int main() {
MyClass obj1(12), obj2(55);
MyClass res = obj1+obj2;
cout << res.var;
}I am not getting the part inside operator+
0 Stimmen
8 AntwortenIn dire need of tutoring or help
0 Stimmen
2 AntwortenStyling Swing Components in java
0 Stimmen
2 Antwortenwhere's the error ?
-3 Stimmen
2 AntwortenData Members and Member functions
-1 Stimme
1 AntwortObjects in heap?
0 Stimmen
1 Antwort"id returned 1 exit status"?
1 Stimme
1 AntwortBinary search guessing game help
0 Stimmen
1 AntwortHow to use inner classes on java
0 Stimmen
2 AntwortenHeute heiß
Time up code for data revision
0 Votes
Best Python Calculator Code
1 Votes
Animation
2 Votes
New code
1 Votes
Clean Code
2 Votes
PHP
1 Votes