English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Java - Which of the following statements are true regarding this fragment of code within the class Vehicle?

public class Vehicle{

int passengers;
int fuelcap;
int mpg;

void range( ) {
System.out.println( "Range is "+ fuelcap * mpg);
}

Pleae only answer if you are absolutly sure.

2006-06-22 09:51:17 · 6 answers · asked by Anonymous in Computers & Internet Programming & Design

answer out of these:

(Choose all correct answers)

A) This code overrides the default constructor

B) This code declares a method

C) The declared method does not return a value

D) The declared method cannot be overridden

E) This code will cause an error

2006-06-22 09:52:09 · update #1

6 answers

B, C, and E are all true.

2006-06-28 03:42:33 · answer #1 · answered by ogretech 2 · 0 0

B, C and E

Missing curly brace gets my vote.

2006-06-23 01:16:13 · answer #2 · answered by AnalProgrammer 7 · 0 0

The integers have to be initialized so E.

2006-06-22 09:57:29 · answer #3 · answered by CJP 3 · 0 0

B and C are true.

2006-06-22 09:57:18 · answer #4 · answered by Otis F 7 · 0 0

Are we doing your homework for you?

2006-06-22 15:26:48 · answer #5 · answered by Anonymous · 0 0

the answer is E.

2006-06-22 09:56:00 · answer #6 · answered by kman 2 · 0 0

fedest.com, questions and answers