logo

Crowdly

Objektorienteeritud programmeerimine (LTAT.03.003)

Looking for Objektorienteeritud programmeerimine (LTAT.03.003) test answers and solutions? Browse our comprehensive collection of verified answers for Objektorienteeritud programmeerimine (LTAT.03.003) at moodle.ut.ee.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

Sea vastavusse Java klass ja eriolukorra tüüp.

View this question

Mis ilmub ekraanile?

try {

   System.out.print("Tere" + " " + 1 / 0);

} catch (ArithmeticException e) {

   System.out.print("Maailm");

}

0%
0%
0%
0%
View this question

Millised read väljastatakse ekraanile?

class Suletav implements AutoCloseable {

   Suletav() {

       System.out.println("Konstruktori sees");

   }

   @Override

   public void close() {

       System.out.println("Sulgesin ennast!");

   }

}

public class SuletavNäide {

   public static void main(String[] args) {

       try (Suletav suletav = new Suletav()) {

           System.out.println("Try sees");

       }

       System.out.println("Pärast");

   }

}
0%
0%
View this question

Antud programm kompileerub.

import java.io.FileNotFoundException;

public class ErindiTest {

   public static void main(String[] args) {

       try {

           System.out.println(1 / 0);

       } catch (FileNotFoundException e){

           System.out.println(e);

       }

   }

}

View this question

Millist Java võtmesõna kasutatakse püünise jaoks?

View this question

Millised read väljastatakse ekraanile?

int[] a = {1, 0};

int b = 0;

try {

   try {

       System.out.println("Vahel");

   } catch (ArrayIndexOutOfBoundsException e) {

       System.out.println("Esimene püünis");

       b = 1/a[1]; 

   }

} catch (ArithmeticException e) {

   System.out.println("Teine püünis");

   b = 1/a[1];

} finally {

   System.out.println("Epiloog");

   b = 1/a[1];

}

System.out.println("Pärast");

View this question

Millised read väljastatakse ekraanile?

int[] a = {1, 0};

int b = 0;

try {

   try {

       b = a[3];

       System.out.println("Vahel");

   } catch (ArrayIndexOutOfBoundsException e) {

       System.out.println("Esimene püünis");

   }

   b = 1/a[1];

} catch (ArithmeticException e) {

   System.out.println("Teine püünis");

} finally {

   System.out.println("Epiloog");

}

System.out.println("Pärast");

0%
0%
0%
View this question

Mis ilmub ekraanile?

public class MinuErind extends Exception {

   private int arv;

   public MinuErind(int arv) {

       this.arv = arv;

   }

   @Override

   public String toString() {

       return "arv";

   }

}
public class TestMinuErind {

   static void meetod(int arv) throws MinuErind{

       throw new MinuErind(arv);

   }

   public static void main(String[] args) {

       try {

           meetod(3);

       } catch (MinuErind e) {

           System.out.println(e);

       }

   }

}

0%
0%
0%
View this question

Mis ilmub ekraanile?

try {

   System.out.print("Tere, maailm! ");

   String a = "12.03";

} finally {

   System.out.println("Epiloog " + a);

}

0%
0%
0%
0%
View this question

Millised järgmistest on korrektsed programmid (kompileeruvad)?

Võib eeldada, et vajalikud asjad on imporditud ja klassi algus ja lõpp ning main-meetod on ka korralikult olemas.

0%
0%
View this question

Want instant access to all verified answers on moodle.ut.ee?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!