Questão
ID 2126616Disciplina: Tecnologia da Informação
Assunto: Java
Ano: 2022 Banca: IFMT - Instituto Federal de Educação, Ciência e Tecnologia de Mato Grosso Órgão: Instituto Federal de Mato Grosso
Qual é a saída do código Java a seguir?
1___class Imu{
2_______int time;
3_______Imu () {
4____________setTime(0);
5_______}
6_______int getTime() {
7____________return time;
8_______}
9_______void setTime(int t) {
10____________time+=t;
11______}
12___}
13
14___class Shot extends Imu{
15_______int d;
16_______int safetime;
17_______Shot () {
18____________d=0;
19____________safetime=240;
20______}
21
22_______void setShot () {
23___________d++;
24______}
25
26_______void checkSafety(){
27____________System.out.print ("Shots:"+this.d);
28____________System.out.print(" Status:");
29____________if(this.d >= 2 && this.getTime() > this.safetime)
30________________System.out.println("Safetyv");
31____________else
32________________System.out.println ("Experimental");
33_______}
34___}
35
36___public class Main {
37_______public static void main(String[] args) {
38___________Shot S = new Shot ();
39___________S.setTime (0);
40___________S.setShot ();
41___________S.setTime (120);
42___________S.setShot ();
43___________S.setTime (120);
44___________S.checkSafety();
45_______}
46___}
47