logo

Crowdly

Browser

Add to Chrome

Об'єктно-орієнтоване програмування

Looking for Об'єктно-орієнтоване програмування test answers and solutions? Browse our comprehensive collection of verified answers for Об'єктно-орієнтоване програмування at virt.ldubgd.edu.ua.

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

Призначення методу join

() в багатопоточному

програмуванні

❌
❌
❌
✅
View this question

Результат компіляції програми:

public class MultipleCatches {

 

       public static void main(String[] args) {

             try {

                    int a = 0;

                    int b = 2 / a;

                    int c[] = new int [1];

                    c[2] = 5;

             } catch (ArithmeticException e) {

                    System.out.println("Ділення на нуль: ");

             } catch (ArrayIndexOutOfBoundsException e) {

                    System.out.println("Помилка індексації за межами масиву: ");

             }

             System.out.println("Після блоку операторів try/catch");

       }

}

0%
0%
0%
0%
View this question

Результат

компіляції програми:

public class Exc_2 {

 

       public static void main(String[] args) {

             int a, b;

            

             try {

                    a = 0;

                    b = 2 / a;

                    System.out.println("Стрічка блоку коду try");

             }catch (ArithmeticException e) {

                    System.out.println("Перехоплено та опрацьовано виключення");

             }

             System.out.println("Продовження ходу виконання програми");

       }

}

❌
✅
❌
View this question

Для

чого служить блок оператора try під

час опрацювання виключень?

❌
❌
❌
✅
View this question

Результат виконання програмного коду:

public class Exception {

 

     public static void main(String[] args) {

           int d = 1;

           int c = 1 – d;

           int a = d / c;

     }

}

✅
❌
❌
❌
View this question

Що

відображає окрема частина трасування стеку «(Exc

eption

.java:7)»

в наведеному фрагменті:

Exception

in thread "main"

java.lang.ArrayIndexOutOfBoundsException:

/ Index out of

bounds for length

     at Package1. Exception.main(Exception.java:7)

0%
0%
0%
0%
View this question

Призначення

оператора

finally

❌
✅
❌
View this question

Які ключові оператори застосовую в Java для опрацювання виключень?

❌
✅
❌
❌
View this question

Результат компіляції програми:

public class FinallyDemo {

       static void A() {

             try {

                    System.out.println("В тілі методу A()");

             } finally {

                    System.out.println("Виконання finally в методі A()");

             }

       }

       static void B() {

             try {

                    System.out.println("В тілі методу В()");

                    return;

             } finally {

                    System.out.println("Виконання finally в методі B()");

             }

       }

       public static void main(String[] args) {

             A();

             B();

       }

}

❌
❌
❌
✅
View this question

Для

чого служить блок оператора catch під

час опрацювання виключень?

❌
✅
❌
❌
View this question

Want instant access to all verified answers on virt.ldubgd.edu.ua?

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

Browser

Add to Chrome