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!

Вкажіть

правильну форму оголошення статичного блоку ініціалізації

0%
0%
0%
0%
View this question

Як

забезпечується доступ  до інкапсульованих

змінних екземплярів класу?

View this question

Якщо члени доступні лише в

межах класу де їх оголошено, то вони позначені модифікатором доступу:

0%
0%
0%
0%
View this question

Якщо члени класу доступні з

будь якого іншого класу в межах програми, то вони оголошені з модифікатором

доступу:

0%
0%
0%
0%
View this question

Можливість використання змінних

як констант, без будь якого ризику випадкової зміни їх значення надає оператор:

View this question

Результат

компіляції програмного коду

class One {

             static int one;

             static int two = 2;

            

             static {

                    one = (int) Math.pow(two, 2);

             }

}

 

public class OneMain {

       public static void main(String[] args) {

            

             System.out.println(One.one/One.two);

       }

}

0%
0%
0%
0%
View this question

Принцип об

єктно-орієнтованого

програмування, який дозволяє використовувати спільний інтерфейс для загального

класу дій, де кожна дія залежить від особливостей конкретної ситуації

View this question

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

програмного коду

class One {

       int a;

       int b;

       int c;

      

       One(int a, int b, int c) {

             this.a = a;

             this.b = b;

             this.c = c;

       }

      

       One(int a, int b) {

             this.a = a;

             this.b = b;

             this.c = b;

       }

 

       void arithmetic() {

             int d = a + b + c;

             System.out

.print(d

+ " ");

       }

}

 

public class Main {

       public static void main(String[] args) {

             One one_1 = new One(1, 2, 3);

             One one_2 = new One(1, 2);

            

             one_1.arithmetic();

             one_2.arithmetic();

       }

}

0%
0%
0%
0%
View this question

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

програми

public class One {

       double arithmetic (double a, double b) {

             return a + b;

       }

 

       int arithmetic(int a) {

             return a*a;

       }

}

 

public class Two {

       double arithmetic (double a, double b) {

             return a - b;

       }

 

       int arithmetic(int a) {

             return a / a;

       }

}

 

public class Main {

 

       public static void main(String[] args) {

             One one = new One();

             Two two = new Two();

            

             System.out.println(one.arithmetic(5));

             System.out.println(two.arithmetic(15, 5));

       }

}

View this question

Результат

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

class One {

       int a;

       int b;

       int c;

      

       One(int a) {

             this.a = a;

             this.b = a;

             this.c = a;

       }

      

       One(int a, int b) {

             this.a = a;

             this.b = b;

             this.c = b;

       }

 

       void arithmetic() {

             int d = a + b + c;

             System.out

.print(d + "

");

       }

}

 

public class Main {

 

       public static void main(String[] args) {

             One one_1 = new One(2);

             One one_2 = new One(1, 2);

            

             one_1.arithmetic();

             one_2.arithmetic();

       }

}

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