logo

Crowdly

Browser

Add to Chrome

Програмування мовою Java

Looking for Програмування мовою Java test answers and solutions? Browse our comprehensive collection of verified answers for Програмування мовою Java at moodle.chnu.edu.ua.

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

Як необхідно змінити програму, щоб доступ до елементів класу A мали тільки класи і елементи того ж пакету newpack?

1 package newpack;

2 class A {

3 int a, b;

4 void sum () {

5 System.out.print (a + b);

6}

7}

8 class B extends A {

9 ...

10}

11 ...

0%
0%
0%
0%
0%
View this question
Що потрібно підставити замість знаків підкреслення, щоб програма вивела на екран "000" ? public class SomeClass {public static void main (String [] args) {____ for (int i = 0; i <b.length; i ++) {System.out.print (b [i]); } } }

(Java)

View this question
У програмі наведено таке опис:

abstract class A {

abstract void method (int a, int b);

}

class B extends A {

int x;

int y;

void method (int a, int b) {

x = a;

y = b;

}

}

Які нижчеперелічені фрагменти коду неприпустимі?

View this question
Які твердження щодо блоку catch вірні?
View this question
Вкажіть результат виконання наступного коду:

public class SomeClass {

public static void main (String [] args) {

SomeClass c = new SomeClass ();

c.f1 (1, 1);

}

public void f1 (byte b, char c) {

System.out.println ( "1");

}

public void f1 (byte b, byte c) {

System.out.println ( "2");

}

public void f1 (char b, char c) {

System.out.println ( "3");

}

public void f1 (char b, byte c) {

System.out.println ( "4");

}

}

(Java)

View this question
Дан наступний клас:

class abcPoint {

abcPoint (int a, int b) {

x = a;

y = b;

}

int x, y;

...

}

Вкажіть результат виконання наступного фрагмента коду:

abcPoint p = new abcPoint (5,3), p1 = p;

px = 4;

System.out.println (p1.x);

(Java)

View this question
Що буде виведено на екран в результаті виконання наступного коду?

import java.awt.Point;

public class Obscuring {

static Point Test = new Point (3,2);

public static void main (String s []) {

System.out.println (Test.x);

}

}

class Test {

static int x = -5;

}

(Java)

View this question
1 class Square {

2 ...

3 double m;

4 double s () {

5 return g * this.m;

6}

7}

View this question
Наведена нижче програма повинна вивести на консоль Hello World! Виберіть рядки, які потрібно модифікувати в вашій програмі, щоб отримати правильний результат.

1 public class SomeClass {

2 public static void main (String [] args) {

3 String [] arr = { "H", "e", "l", "l", "o", "", "W", "o", "r", "l", "d", "!" };

4 String result = "";

5 int i = 0;

6 ...

7 System.out.print (arr [i]);

8 }

9 }

(Java)

View this question
Нехай класи Wolf і Rabbit є спадкоємцями класу Animal . Коректний такий приклад?

Wolf w = new Wolf ();

Animal a = (Animal) w;

Rabbit r = (Rabbit) a;

(Java)

View this question

Want instant access to all verified answers on moodle.chnu.edu.ua?

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

Browser

Add to Chrome