
Câu hỏi trắc nghiệm Lập trình Java
Authored by Phong Nguyen
Mathematics
University
Used 4+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
85 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Tính đóng gói trong Java là gì?
Cho phép một lớp kế thừa từ một lớp khác.
Ẩn chi tiết triển khai bên trong và chỉ cung cấp giao diện công khai.
Cho phép một phương thức có nhiều hình thức khác nhau.
Tạo ra các đối tượng từ một lớp trừu tượng.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Đâu là cách sử dụng tính đóng gói đúng trong Java?
public class Student { public String name; public int age; }
public class Student { private String name; private int age; public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } }
public class Student { private String name; public int age; }
public class Student { public String name; private int age; }
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Tính đóng gói có thể được cải thiện bằng cách nào?
Sử dụng các thuộc tính public để truy cập trực tiếp.
Kết hợp các thuộc tính private với các phương thức getter/setter công khai.
Sử dụng từ khóa static cho tất cả các thuộc tính.
Loại bỏ các phương thức setter để ngăn sửa đổi dữ liệu.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Đâu là cách sử dụng tính đóng gói đúng trong Java?
class Employee { public String name; public double salary; }
class Employee { private String name; private double salary; public String getName() { return name; } public void setName(String name) { this.name = name; } public double getSalary() { return salary; } public void setSalary(double salary) { this.salary = salary; } }
class Employee { private String name; public double salary; }
class Employee { public String name; private double salary; }
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Trong Java, để đảm bảo tính đóng gói, các thuộc tính của lớp nên được khai báo với từ khóa ________, và truy cập thông qua các phương thức getter/setter.
public
private
protected
static
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
o tính đóng gói, các thuộc tính của lớp nên được khai báo với từ khóa ________, và truy cập thông qua các phương thức getter/setter.
public
private
protected
static
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Từ khóa nào trong Java được sử dụng để thực hiện kế thừa?
implements
extends
super
this
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
29 questions
Alg. 1 Section 5.1 Coordinate Plane
Quiz
•
9th Grade
22 questions
fractions
Quiz
•
3rd Grade
11 questions
FOREST Effective communication
Lesson
•
KG
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for Mathematics
7 questions
Introduction to Fractions
Interactive video
•
1st Grade - University
14 questions
Transformations of Quadratic Functions
Quiz
•
KG - University
16 questions
Say it with Symbols Review
Quiz
•
7th Grade - University
20 questions
Special Right Triangles
Quiz
•
8th Grade - University
7 questions
Learning Check: 1 step Equations
Quiz
•
9th Grade - University
17 questions
Differential Equations Review
Quiz
•
11th Grade - University