What is the purpose of a constructor in a Java class?
ما هو الغرض من منشئ في فئة جافا؟
ما هو الغرض من منشئ في فئة جافا؟
في جافا لو المتغير private وماحطينا دوال داخل الكلاس للوصول لهذا المتغير هل نقدر نغير او نوصل لهذا المتغير بشكل مباشر من ال main method
جافا Java
في جافا لو المتغير private وماحطينا دوال داخل الكلاس للوصول لهذا المتغير هل نقدر نغير او نوصل لهذا المتغير بشكل مباشر من ال main method
اتوقع 80% بيجاوب غلط 🫢
Please open Telegram to view this post
VIEW IN TELEGRAM
How do you define a one-line comment in Java?
Anonymous Quiz
83%
// This is a comment
12%
/* This is a comment */
2%
<!-- This is a comment -->
3%
# This is a comment
In Java, what is a 'package' and how is it used?
في جافا، ما هو 'الحزمة' وكيف يتم استخدامها؟
في جافا، ما هو 'الحزمة' وكيف يتم استخدامها؟
What is the correct syntax to print a message in Java?
Anonymous Quiz
96%
System.out.println("Hello, World!");
1%
print("Hello, World!");
2%
Console.WriteLine("Hello, World!");
1%
echo("Hello, World!");
In Java, what is a 'package' and how is it used?
في جافا، ما هو 'الحزمة' وكيف يتم استخدامها؟
في جافا، ما هو 'الحزمة' وكيف يتم استخدامها؟
What is the output of the following Java code?
```java
System.out.println(10 > 9); ```
```java
System.out.println(10 > 9); ```
Anonymous Quiz
76%
true
13%
false
8%
1
3%
0
Consider the following Java code snippet. What will be the output?
فكر في الشفرة البرمجية جافا التالية. ماذا سيكون المخرج؟
class Base {
void display() {
System.out.println("Base display()");
}
}
class Derived extends Base {
void display() {
System.out.println("Derived display()");
}
}
public class Test {
public static void main(String[] args) {
Base obj = new Derived();
obj.display();
}
}
فكر في الشفرة البرمجية جافا التالية. ماذا سيكون المخرج؟
Which of the following is not a valid way to create an instance of a class named `MyClass` in Java?
Anonymous Quiz
45%
MyClass obj = new MyClass();
14%
new MyClass();
23%
MyClass obj = MyClass.new();
17%
MyClass obj = MyClass();
❤3
What is the output of the following Java code snippet demonstrating the concept of method overriding?
ما هو مخرج الشفرة البرمجية جافا التالية التي توضح مفهوم إعادة تعريف الطريقة؟
class Vehicle {
void run() {
System.out.println("Vehicle is running");
}
}
class Bike extends Vehicle {
void run() {
System.out.println("Bike is running safely");
}
}
public class Test {
public static void main(String[] args) {
Bike obj = new Bike();
obj.run();
}
}
ما هو مخرج الشفرة البرمجية جافا التالية التي توضح مفهوم إعادة تعريف الطريقة؟
👍2❤1
Which of the following is not OOPS concept in Java?
Anonymous Quiz
70%
Compilation
15%
Polymorphism
7%
Inheritance
8%
Encapsulation
Which concept of Java is a way of converting real world objects in terms of class?
Anonymous Quiz
27%
Inheritance
27%
Encapsulation
26%
Abstraction
19%
Polymorphism
Which of the following is a valid declaration of an object of class Box?
Anonymous Quiz
7%
new Box obj;
75%
Box obj = new Box();
7%
obj = new Box();
10%
Box obj = new Box;
Which keyword is used by the method to refer to the object that invoked it?
Anonymous Quiz
22%
import
66%
this
10%
abstract
2%
abstract
Which keyword is used in Java to create a new instance of a class?
Anonymous Quiz
76%
new
21%
class
0%
struct
3%
create
Identify and correct the error in the following Java code snippet to demonstrate the correct use of an abstract class.
حدد وصحح الخطأ في الشفرة البرمجية جافا التالية لتوضيح الاستخدام الصحيح للصف المجرد.
abstract class Animal {
abstract void eat();
}
class Dog extends Animal {
void eat() {
System.out.println("Dog eats");
}
}
public class TestAnimal {
public static void main(String[] args) {
Animal a = new Dog();
a.eat();
}
}
حدد وصحح الخطأ في الشفرة البرمجية جافا التالية لتوضيح الاستخدام الصحيح للصف المجرد.
How do you define an interface in Java?
Anonymous Quiz
41%
class interfaceName {}
40%
interface interfaceName {}
15%
Interface interfaceName {}
5%
def interface interfaceName {}