subject

Consider a method defined with the header: public static void doStuff(double a, int b)
Which of the following method calls is NOT legal?
int x = 9;
int y = 36;
doStuff (x, y);
doStuff (5.5, 7);
doStuff (5, 7);
doStuff (5, 7.5);
int z = 55;
doStuff (z, z + 1);
Consider the following variables and method representing a student.
private double gpa;
private int gradeLevel;

public boolean honorRoll()
{
/* Missing Code */
}
A student is placed on the honor role if their GPA is 3.5 or above, and they are in the 11th or 12th grade.
Which of the following correctly replaces /* missing code */ so that the method works as intended?
I. if ((gpa >= 3.5) && ((gradeLevel == 11) || (gradeLevel == 12)))
return true;
return false;
II. boolean pass = false;
if (gpa >= 3.5);
pass = true;
if ((gradeLevel == 11) || (gradeLevel == 12))
pass = true;
return pass;
III. if ((gpa >= 3.5) || ((gradeLevel == 11) || (gradeLevel == 12)))
return true;
return false;
I only
II only
III only
II & III
I, II, & III
When a parameter is a(n) data type, any changes made in a method are preserved.
int
binary
actual
class
primitive
What mistake is in the following code?
public static void mystery(double a) {
System. out. println(a * 3.14);
return a * 3.14;
}
It should say return true;
The return value should be a boolean.
The parameter should be a boolean type.
A method whose return type is void cannot return a value.
A method cannot return a double.
What return statement may be used in the following method?
public static int p() {
//...
}
return 1;
return {1, 2, 3};
return int[]{1, 2, 3};
return new int[]{1, 2, 3};
return p[1]
When you pass a double variable to a method, the method receives .
a copy of the memory address
the reference of the variable
the length of the variable
a copy of the variable
binary of the memory address
What is output by the following code?
String q = "onomatopoeia";
String r = "splat";
System. out. println( q. indexOf( r. charAt (3)));
4
5
12
a
t

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 16:30, nxusasmangaliso1191
The most common battery cable terminal is a that provides a large surface contact area with the ability to tighten the terminal onto the battery post using a nut and bolt.
Answers: 2
image
Computers and Technology, 22.06.2019 18:30, yayamcneal05
Which cultural aspect does this type of song best portray? a german polka dance
Answers: 1
image
Computers and Technology, 23.06.2019 01:00, lusciousl
Petrică, tânăr licean în clasa a ix-a, a primit în dar de la părinţii săi un cont bancar pentru micile sale cheltuieli curente. el este pasionat de internet banking şi îşi verifică cu grijă toate tranzacţiile efectuate. pentru creşterea securităţii tranzacţiilor online, banca îi furnizează lui petrică un număr pe care el va trebui să îl modifice, obţinând un număr tan – număr de autentificare a tranzacţiei (transaction authentication number). regula de obţinere a numărului tan este următoarea: se formează cel mai mic număr par din toate cifrele numărului furnizat de bancă. cerinţă cunoscând numărul n furnizat de bancă, să se determine numărul tan obţinut de petrică. date de intrare fişierul tan. in conţine pe prima linie numărul natural n cu semnificaţia din enunţ. date de ieşire fişierul de ieşire tan. out va conţine o singură linie pe care va fi scris numărul tan cerut. restricţii • 0 < n < 18*1018 • n are cel puţin o cifră pară • numărul tan obţinut nu poate conţine zerouri nesemnificative
Answers: 2
image
Computers and Technology, 24.06.2019 01:30, kevin72836
Hazel has just finished adding pictures to her holiday newsletter. she decides to crop an image. what is cropping an image?
Answers: 1
You know the right answer?
Consider a method defined with the header: public static void doStuff(double a, int b)
Which...

Questions in other subjects:

Konu
Computers and Technology, 26.01.2022 03:10
Konu
Mathematics, 26.01.2022 03:10
Konu
History, 26.01.2022 03:10
Konu
History, 26.01.2022 03:10