PRO192_-_SP_2024_-_Block_5_-_RE_1965.webp
T

PRO192_-_SP_2024_-_Block_5_-_RE_1965.webp

}
(Choose 1 answer)
Given the following. What is the result?
public class Example {
public static void main(String[] args) {
Student S1 = new Student("SV01", "Lan", 5,7);System.out.println(S1);
}
abstract class Person {
String code, name;
public Person(String code, String name) {
this.code = code;
this.name = name;
}
public abstract double getAverage();
@Override
public String toString() {
return code + "\t" + name + "\t" + getAverage();
}
}
class Student extends Person {
double mark1, mark2;
public Student(String code, String name, double mark 1, double mark2) {
super(code, name);
this.mark1 = mark1;
this.mark2 = mark2;
}
public double getAverage() {
return (mark1+mark2)/2;
}
}
A. Compilation fails
B. Exception is thrown at runtime
C. SV01 Lan 6.0

Thông tin

Category
PRO192
Thêm bởi
thanhhoa88
Ngày thêm
Lượt xem
5,843
Lượt bình luận
18
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
PRO192_-_SP_2024_-_Block_5_-_RE_1965.webp
File size
271.7 KB
Dimensions
1920px x 1012px

Share this media

Back
Bên trên Bottom