Обсуждения
Vector of doubles from block of bytes
0 голосов
1 ответ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 голос
2 ответовWrite a program that uses a dynamic array that contains 5 items of double values. The size of the array is entered when the program is run. Aldo the 5 values must be entered. These tasks are done in the main ( ) function. Then write a function to display the 5 values. The function must have a pointer variable as a parameter. The function is called from the main ( ).
0 голосов
2 ответов