1/9
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
which option can be the header of a user-defined method which takes one input of type double and returns an output of type int?
public static int MyMethod(double input)
suppose you defined a method with the following header. which statement correctly calls the function in the main method?
public static void MyMethod(int input)
MyMethod(6);
which statement defines a two-dimensional array with components of type double and with 2 rows and 5 columns?
double[][] MyArray = new double[2][5];
which one is not a correct statement?
double[] MyArray = {{1}, {2}, {4}};
which statement is assigning value to the component in the second row and the third
column of a two-dimensional array named MyArray?
MyArray[1][2] = 5;
which of the following statements return the number of characters in a String variable
named Message?
System.out.println(Message.length())
which statement is not correct?
char letter = “B”;
suppose you defined a class named circle. This class has one double attribute named Radius, and one double attribute named Area. which is a “constructor” that assigns value to Radius and calculate the area of the circle, assigning value to Area?
Circle(double newRadius){
Radius = newRadius;
Area = Radius *Radius* Math.PI;
}
suppose you defined a class named Circle. this class has one double attribute named Radius, and one constructor that take an input and assign it to Radius. which statement defines an object of type Circle?
Circle NewCircle = new Circle(10);
suppose you defined a class named Car. which statement declares a one-dimensional array of size 10 with components which are objects of type Car?
Car[ ] CarArray= new Car[10];