Computers and Technology

If name is a String instance variable, average is a double instance variable, and numOfStudents is a static int variable, why won’t the following code from a class compile?public Student(String s) {name = s;average = getAverage(name);numOfStudents++;}p ublic double getAverage(String x) {numOfStudents++;double ave = StudentDB. getAverage(x);return ave;}public static void setAverage(double g) {average = g;}a. The setAverage() method can’t access the average instance variable. b.The getAverage() method can’t increment the numOfStudents variable. c.The constructor can’t increment the numOfStudents variable. d.The getAverage() method can’t call a static method in the StudentDB class.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 23:00, bankscorneliuso39
Fast sportcars the top speeds of sportscars, given in miles per hour, are: 155 mph bmw m5 217 mph lamborghini aventador spyder 205 mph ferrari 488 205 mph nissan gtr 197 mph chevrolet corvette stingray zr1 258 mph bugatti veyron supersport 195 mph dodge viper 270 mph hennessey venom 155 mph bmw m3 195 mph mercedes sl given: topspeeds=[155; 217; 205; 205; 197; 258; 195; 270; 155; 195]; carnames=string(["bmw m5" "lamborghini aventador spyder" "ferrari 488" "nissan gtr" "chevrolet corvette stingray zr1" "bugatti veyron supersport" "dodge viper" "hennessey venom" "bmw m3" "mercedes sl"]); the variable is a rectangular array. write a function called selectcars to identify cars with the top speed within a given range, and display the identified names. the selected cars speed will be in a range given by lowerbound < speed < upperbound. inputs to the function selectcars are: a column array os all car top speeds named topspeeds, the corresponding chara
Answers: 2
image
Computers and Technology, 24.06.2019 05:30, lexie2751
How do i get rid of my member ship for
Answers: 2
image
Computers and Technology, 24.06.2019 18:10, albattatasraap5wymy
Most information security incidents will occur because of select one: a. users who do not follow secure computing practices and procedures b. increases in hacker skills and capabilities c. poorly designed network protection software d. increasing sophistication of computer viruses and worms
Answers: 1
image
Computers and Technology, 24.06.2019 20:10, austinwst3
Approximately what portion of global employers tends to use social media websites to hire new employees?
Answers: 1
Do you know the correct answer?
If name is a String instance variable, average is a double instance variable, and numOfStudents is a...

Questions in other subjects:

Konu
Mathematics, 04.05.2020 23:07
Konu
Mathematics, 04.05.2020 23:07
Konu
Geography, 04.05.2020 23:07