جافا Java
前往频道在 Telegram
6 165
订阅者
-124 小时
-177 天
-6830 天
帖子存档
6 165
Correct the error in the following Java code snippet that attempts to override a method in a subclass.
class SuperClass {
protected void display() {
System.out.println("SuperClass display");
}
}
class SubClass extends SuperClass {
private void display() {
System.out.println("SubClass display");
}
}
صحح الخطأ في الشفرة البرمجية جافا التالية التي تحاول إعادة تعريف طريقة في فئة فرعية.6 165
Correct the error in the following Java code snippet that defines a method to calculate the sum of two integers.
public int sum(int a, int b) {
return a + b
}
صحح الخطأ في الشفرة البرمجية جافا التالية التي تعرف طريقة لحساب مجموع عددين صحيحين.6 165
What will be the output of the following Java program that demonstrates the concept of inheritance?
class Animal {
String sound() { return "Some sound"; }
}
class Dog extends Animal {
String sound() { return "Bark"; }
}
public class TestInheritance {
public static void main(String[] args) {
Animal myDog = new Dog();
System.out.println(myDog.sound());
}
}
ماذا سيكون المخرج للبرنامج جافا التالي الذي يوضح مفهوم الوراثة؟6 165
In Java, which keyword is used to inherit properties and methods from another class?
6 165
🚨 ATTENTION 🚨
Friends, I asked for a special link from binance free vip channel, don't miss ❗
Only 100 Members Exclusive Link 👇👇👇
https://t.me/+tY1KS_VpiFozNWZi
LIMITED TIME OPEN LINK ❗
6 165
What will be the output of the following Java code snippet demonstrating the use of abstract classes?
abstract class Shape {
abstract void draw();
}
class Rectangle extends Shape {
void draw() {
System.out.println("Drawing Rectangle");
}
}
public class Test {
public static void main(String[] args) {
Shape shape = new Rectangle();
shape.draw();
}
}
ماذا سيكون المخرج للشفرة البرمجية جافا التالية التي توضح استخدام الصفوف المجردة؟6 165
Which of these is the correct way to define a constructor that takes a string and an integer as arguments in a class named `Person` in Java?
6 165
What is the output of the following Java code snippet demonstrating the use of a for-each loop?
int[] numbers = {1, 2, 3, 4, 5};
for(int num : numbers) {
System.out.print(num + " ");
}
ما هو مخرج الشفرة البرمجية جافا التالية التي توضح استخدام حلقة for-each؟6 165
Fix the error in the following Java code snippet to correctly calculate the factorial of a number using recursion.
public int factorial(int n) {
if (n == 1)
return 1;
else
return n * factorial(n - 1);
}
أصلح الخطأ في الشفرة البرمجية جافا التالية لحساب عامل رقم باستخدام العودية بشكل صحيح.6 165
What is the output of the following Java code snippet?
String name = "Java";
System.out.println(name instanceof String);
ما هو مخرج الشفرة البرمجية جافا التالية؟6 165
🔴 الحق قبل الحذف🔴
قناة برمجة وتطوير لكل مايهمك بالبرمجة 👨💻🔥
@pro2dev
@pro2dev
@pro2dev
t.me/pro2dev
6 165
What will be the output of the following Java code snippet that demonstrates the use of the 'instanceof' keyword?
class Parent {}
class Child extends Parent {}
public class Test {
public static void main(String[] args) {
Parent obj = new Child();
System.out.println(obj instanceof Child);
}
}
ماذا سيكون المخرج للشفرة البرمجية جافا التالية التي توضح استخدام كلمة 'instanceof'؟