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!

Millised read väljastatakse ekraanile?

int a = 0;

try {

   System.out.println("Üks");

   a = 1/1;

   System.out.println("Kaks");

} catch (Exception e) {

   System.out.println("Kolm");

   a = 1/0;

   System.out.println("Neli");

} finally {

   System.out.println("Viis");

}

System.out.println("Kuus");

0%
0%
0%
0%
View this question
Millised read väljastatakse ekraanile?

try {

   System.out.println("Üks");

   int a = 1/0;

   System.out.println("Kaks");

   throw new NullPointerException("Kolm");

} catch (ArithmeticException e) {

   System.out.println("Neli");

} catch (NullPointerException e) {

   System.out.println("Viis");

} finally {

   System.out.println("Kuus");

}

System.out.println("Seitse");
100%
0%
0%
100%
0%
100%
100%
0%
0%
View this question

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

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

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