Đề Thi FE LAB221c - SP26 - FE

adminadmin is verified member.

Member
Thành viên BQT
Administrator
Học kỳ
SP2026
Thời Gian
9/5/26
Loại tài liệu
FE
LAB221c SP26 FE
1. (Choose 1 answer)

What is a loop?
A. A new type of Applet.
B. A segment of code to be run a specified amount of times
C. A segment of code to be run infinite times
D. A segment of code to be run once
2. (Choose 1 answer)

Which definition best defines the concept of abstraction?
A. Hides the important data
B. Hides the implementation and showing only the features
C. Hiding the implementation
D. Showing the important data
3. (Choose 1 answer)

What is the output of the following code fragment: int[] ar = {2, 4, 6, 8}; System.out.println( ar[0] + " " + ar[1] );
A. 2 6
B. 8
C. 2 4
D. 6 8
4. (Choose 1 answer)

Using the concept of encapsulation security of the data is ________
A. Ensured to some extent
B. Purely ensured
C. Not ensured
D. Very low
5. (Choose 1 answer)

Choose the appropriate data type for this field: isSwimmer
A. double
B. boolean
C. String
D. int
6. (Choose 1 answer)

An object could be...
A. anything
B. an algorithm
C. a data container
D. a program
7. (Choose 1 answer)

What is the purpose of the "final" keyword in Java?
A. To prevent the inheritance of a class
B. To prevent overriding of a method
C. To prevent modification of a variable's value
D. All of the above
8. (Choose 1 answer)

What is the result of the expression: 10+5*8-15/5
A. 3
B. 47
C. 7
D. 21
9. (Choose 1 answer)

___ provides a standard interface to common system resources.
A. new
B. API
C. System
D. None of the above
10. (Choose 1 answer)

___ is used as a base class to derive specific classes of the same kind.
A. private
B. friend class
C. abstract class
D. superclass
11. (Choose 1 answer)

What is the purpose of the "super" keyword in Java?
A. To refer to the current object
B. To invoke the superclass constructor or methods
C. To create multiple instances of a class
D. To hide data and methods within a class
12. (Choose 1 answer)

What is the concept of data hiding in Java?
A. Encapsulating data within a class and providing controlled access through methods
B. Making data accessible to all classes in the program
C. Storing data in a central repository accessible to multiple classes
D. Restricting access to data within a specific package
13. (Choose 1 answer)

Which among the following feature does not come under the concept of OOPS?
A. Data binding
B. Data hiding
C. Platform independent
D. Message passing
14. (Choose 1 answer)

Choose the appropriate data type of this value: 5.5
A. int
B. double
C. boolean
D. String
15. (Choose 1 answer)

Following code will result in: int num = 6.7;
A. Compilation error
B. Runtime error
C. num being 6.7
D. num being 6
16. (Choose 1 answer)

The concept of encapsulation helps in writing which type of classes in the Java programming language?
A. Abstract classes
B. Wrapper classes
C. Mutable classes
D. Immutable classes
17. (Choose 1 answer)

What is encapsulation in Java?
A. The process of combining data and methods into a single unit
B. The process of hiding data and methods within a class
C. The process of creating multiple instances of a class
D. The process of reusing code from existing classes
18. (Choose 1 answer)

The ___ statement takes an object of an exception class as a parameter.
A. try
B. if
C. catch
D. finally
19. (Choose 1 answer)

What is the difference between static and instance variables in Java?
A. Static variables are associated with an instance of a class, while instance variables are associated with the class itself
B. Static variables are shared among all instances of a class, while instance variables have separate values for each instance
C. Static variables can be accessed without creating an object, while instance variables require an object reference
D. All of the above
20. (Choose 1 answer)

The principle of abstraction___________
A. is used to achieve OOPS.
B. is used to avoid duplication
C. Use abstraction at its minimum
D. is used to remove longer codes
21. (Choose 1 answer)

What is the output for the following code: System.out.println ("Hello World");
A. Shows error
B. Hello World
C. "Hello World"
D. None of the above
22. (Choose 1 answer)

Which of the following language uses the classes but not the polymorphism concept?
A. Procedure Oriented language
B. Object-based language
C. Class-based language
D. If classes are used, then the polymorphism concept will always be used in the programming languages
23. (Choose 1 answer)

What is the size of a class?
A. Sum of the size of all inherited variables along with the variables of the same class
B. The size of the class is the largest size of the variable of the same class
C. Classes in the programming languages do not have any size
D. Sum of the size of all the variables within a class.
24. (Choose 1 answer)

Which of the following statement of a program is not right?
A. class teacher{}; teacher s[5];
B. class teacher{}s;
C. class teacher{}; teacher s;
D. class teacher{}s[];
25. (Choose 1 answer)

Which loop always executes its body at least once, even though the condition is not true:
A. for
B. do-while
C. continue
D. while-do
26. (Choose 1 answer)

What is an assignment statement?
A. Adding a number to an int
B. Assigning a multiplication
C. Assigning a name to a variable
D. Assigning a value to a variable
27. (Choose 1 answer)

What is the difference between method overloading and method overriding in Java?
A. Method overloading occurs within the same class, while method overriding occurs between different classes.
B. Method overloading involves creating multiple methods with the same name but different parameters, while method overriding involves providing a different implementation for an inherited method
C. Method overloading is a compile-time polymorphism concept, while method overriding is a runtime polymorphism concept
D. All of the above.
28. (Choose 1 answer)

Which of the following allows the creation of hierarchical classifications?
A. Interface
B. Inheritance
C. Package
D. Polymorphism
29. (Choose 1 answer)

Both the String and StringBuffer classes are defined in ___ package:
A. java.awt
B. java.io
C. java.lang
D. java.util
30. (Choose 1 answer)

What is the size of a Char in Java?
A. 4 bits
B. 7 bits
C. 8 bits
D. 16 bits
31. (Choose 1 answer)

Which among the following is not a member of the class?
A. Virtual function
B. const function
C. Static function
D. Friend function
32. (Choose 1 answer)

What is the purpose of the "this" keyword in Java?
A. To refer to the superclass
B. To create multiple instances of a class
C. To hide data and methods within a class
D. To refer to the current object
33. (Choose 1 answer)

Which is NOT a section of all types of loops?
A. Initialization
B. Loop Body
C. Test statement
D. The word "while"
34. (Choose 1 answer)

Which one is not correct?
A. A class needs to be instantiated as an object before being used
B. An objects exists in memory in run time
C. Class and object are just different names for the same thing
D. An object is a variable, where its type is the class used to declare the variable
35. (Choose 1 answer)

Which two features of object-oriented programming are the same?
A. Abstraction and Polymorphism features are the same
B. Inheritance and Encapsulation features are the same
C. Encapsulation and Polymorphism features are the same
D. Encapsulation and Abstraction
36. (Choose 1 answer)

Which of the following syntax is incorrect for the class definition?
A. student class{};
B. class student{ student(int a){}}
C. class teacher{ public: teacher(int a){ }}
D. None of the mentioned
37. (Choose 1 answer)

Choose the best definition of an object
A. an instance of a class
B. something you wear
C. A class
D. A data type
38. (Choose 1 answer)

Which feature of Java is used to dynamically link code in a safe and expedient manner:
A. Secure
B. Distributed
C. Dynamic
D. Robust
39. (Choose 1 answer)

If classes Student, Staff and Faculty extend class Person, which one makes sense
A. Faculty[] faculties={new Person(), new Staff(), new Student()};
B. Staff[] staff={new Person(), new Faculty(), new Student()};
C. Person[] persons={new Faculty(), new Staff(), new Student()};
D. None of the others
40. (Choose 1 answer)

Which of the following method can be used to set the size of the buffer?
A. ensureCapacity()
B. length()
C. setLength()
D. ResizeBuffer()
41. (Choose 1 answer)

Which of the following feature may be breaked if the user does not use the classes in the code?
A. Object must be used violated
B. Only the encapsulation concept is violated
C. Inheritance cannot be implemented
D. Basically, all the features of OOPS get violated
42. (Choose 1 answer)

___ is a common programming construct that is based upon a sequence of nested if
A. switch
B. nested if
C. if-else-if ladder
D. None of the above
43. (Choose 1 answer)

Integer a = new Integer(2); Integer b = new Integer(2); What happens when you do if (a==b)?
A. Compiler error
B. Runtime Exception
C. True
D. False
44. (Choose 1 answer)

What is the difference between a class and an object in Java?
A. A class is a blueprint for creating objects, while an object is an instance of a class.
B. A class is a single entity, while an object is a collection of entities.
C. A class contains data and methods, while an object only contains data.
D. A class cannot be instantiated, while an object can be created and used.
45. (Choose 1 answer)

Which class cannot create its instance?
A. Parent class
B. Nested class
C. Anonymous class
D. Abstract class
46. (Choose 1 answer)

Which member function is assumed to call first when there is a case of using function overloading or abstract class?
A. Global function
B. Local function
C. Function with lowest priority
D. Function with the highest priority
47. (Choose 1 answer)

Which function best describe the concept of polymorphism in programming languages?
A. Class member function
B. Virtual function
C. Inline function
D. Undefined function
48. (Choose 1 answer)

What are the legal indexes for the array ar, given the following declaration? int[] ar = {2, 4, 6, 8};
A. 0,1,2,3
B. 1,2,3,4
C. 2,4,6,8
D. 0,2,4,6
49. (Choose 1 answer)

Which of the following definition is incorrect for polymorphism?
A. Polymorphism helps in redefining the same functionality
B. Polymorphism concept is the feature of object-oriented programming (OOP)
C. It always increases the overhead of function definition
D. Ease in the readability of the program
50. (Choose 1 answer)

What are abstract classes in Java?
A. Classes that cannot be instantiated
B. Classes that can be used as blueprints for creating objects
C. Classes that only contain abstract methods
D. All of the above
 

Đính kèm

  • LAB221c SP26 FE_11.webp
    LAB221c SP26 FE_11.webp
    23 KB · Lượt xem: 1
  • LAB221c SP26 FE_01.webp
    LAB221c SP26 FE_01.webp
    20.4 KB · Lượt xem: 1
  • LAB221c SP26 FE_02.webp
    LAB221c SP26 FE_02.webp
    22.7 KB · Lượt xem: 0
  • LAB221c SP26 FE_03.webp
    LAB221c SP26 FE_03.webp
    16.4 KB · Lượt xem: 0
  • LAB221c SP26 FE_04.webp
    LAB221c SP26 FE_04.webp
    16.8 KB · Lượt xem: 0
  • LAB221c SP26 FE_05.webp
    LAB221c SP26 FE_05.webp
    14.3 KB · Lượt xem: 0
  • LAB221c SP26 FE_06.webp
    LAB221c SP26 FE_06.webp
    13.2 KB · Lượt xem: 0
  • LAB221c SP26 FE_07.webp
    LAB221c SP26 FE_07.webp
    21.2 KB · Lượt xem: 0
  • LAB221c SP26 FE_08.webp
    LAB221c SP26 FE_08.webp
    12.1 KB · Lượt xem: 0
  • LAB221c SP26 FE_09.webp
    LAB221c SP26 FE_09.webp
    15 KB · Lượt xem: 0
  • LAB221c SP26 FE_10.webp
    LAB221c SP26 FE_10.webp
    16.3 KB · Lượt xem: 0
  • LAB221c SP26 FE_12.webp
    LAB221c SP26 FE_12.webp
    30.6 KB · Lượt xem: 0
  • LAB221c SP26 FE_13.webp
    LAB221c SP26 FE_13.webp
    19 KB · Lượt xem: 0
  • LAB221c SP26 FE_14.webp
    LAB221c SP26 FE_14.webp
    13.7 KB · Lượt xem: 0
  • LAB221c SP26 FE_15.webp
    LAB221c SP26 FE_15.webp
    15.3 KB · Lượt xem: 0
  • LAB221c SP26 FE_16.webp
    LAB221c SP26 FE_16.webp
    20.9 KB · Lượt xem: 0
  • LAB221c SP26 FE_17.webp
    LAB221c SP26 FE_17.webp
    26.8 KB · Lượt xem: 0
  • LAB221c SP26 FE_18.webp
    LAB221c SP26 FE_18.webp
    14.3 KB · Lượt xem: 0
  • LAB221c SP26 FE_19.webp
    LAB221c SP26 FE_19.webp
    41.2 KB · Lượt xem: 0
  • LAB221c SP26 FE_20.webp
    LAB221c SP26 FE_20.webp
    18.7 KB · Lượt xem: 0
  • LAB221c SP26 FE_21.webp
    LAB221c SP26 FE_21.webp
    17.8 KB · Lượt xem: 0
  • LAB221c SP26 FE_22.webp
    LAB221c SP26 FE_22.webp
    28.2 KB · Lượt xem: 0
  • LAB221c SP26 FE_23.webp
    LAB221c SP26 FE_23.webp
    29.8 KB · Lượt xem: 0
  • LAB221c SP26 FE_24.webp
    LAB221c SP26 FE_24.webp
    19.3 KB · Lượt xem: 0
  • LAB221c SP26 FE_25.webp
    LAB221c SP26 FE_25.webp
    16.7 KB · Lượt xem: 0
  • LAB221c SP26 FE_26.webp
    LAB221c SP26 FE_26.webp
    19.3 KB · Lượt xem: 0
  • LAB221c SP26 FE_27.webp
    LAB221c SP26 FE_27.webp
    48.3 KB · Lượt xem: 0
  • LAB221c SP26 FE_28.webp
    LAB221c SP26 FE_28.webp
    16.8 KB · Lượt xem: 0
  • LAB221c SP26 FE_29.webp
    LAB221c SP26 FE_29.webp
    15.6 KB · Lượt xem: 0
  • LAB221c SP26 FE_30.webp
    LAB221c SP26 FE_30.webp
    12.4 KB · Lượt xem: 0
  • LAB221c SP26 FE_31.webp
    LAB221c SP26 FE_31.webp
    16.5 KB · Lượt xem: 0
  • LAB221c SP26 FE_32.webp
    LAB221c SP26 FE_32.webp
    21.3 KB · Lượt xem: 0
  • LAB221c SP26 FE_33.webp
    LAB221c SP26 FE_33.webp
    15.5 KB · Lượt xem: 0
  • LAB221c SP26 FE_34.webp
    LAB221c SP26 FE_34.webp
    28 KB · Lượt xem: 0
  • LAB221c SP26 FE_35.webp
    LAB221c SP26 FE_35.webp
    27.6 KB · Lượt xem: 0
  • LAB221c SP26 FE_36.webp
    LAB221c SP26 FE_36.webp
    21.3 KB · Lượt xem: 0
  • LAB221c SP26 FE_37.webp
    LAB221c SP26 FE_37.webp
    15.7 KB · Lượt xem: 0
  • LAB221c SP26 FE_38.webp
    LAB221c SP26 FE_38.webp
    16.9 KB · Lượt xem: 0
  • LAB221c SP26 FE_39.webp
    LAB221c SP26 FE_39.webp
    29.2 KB · Lượt xem: 0
  • LAB221c SP26 FE_40.webp
    LAB221c SP26 FE_40.webp
    17.5 KB · Lượt xem: 0
  • LAB221c SP26 FE_41.webp
    LAB221c SP26 FE_41.webp
    26.8 KB · Lượt xem: 0
  • LAB221c SP26 FE_42.webp
    LAB221c SP26 FE_42.webp
    17.4 KB · Lượt xem: 0
  • LAB221c SP26 FE_43.webp
    LAB221c SP26 FE_43.webp
    18 KB · Lượt xem: 0
  • LAB221c SP26 FE_44.webp
    LAB221c SP26 FE_44.webp
    34.2 KB · Lượt xem: 0
  • LAB221c SP26 FE_45.webp
    LAB221c SP26 FE_45.webp
    15.3 KB · Lượt xem: 0
  • LAB221c SP26 FE_46.webp
    LAB221c SP26 FE_46.webp
    23.1 KB · Lượt xem: 0
  • LAB221c SP26 FE_47.webp
    LAB221c SP26 FE_47.webp
    19.7 KB · Lượt xem: 0
  • LAB221c SP26 FE_48.webp
    LAB221c SP26 FE_48.webp
    17 KB · Lượt xem: 0
  • LAB221c SP26 FE_49.webp
    LAB221c SP26 FE_49.webp
    29.8 KB · Lượt xem: 0
  • LAB221c SP26 FE_50.webp
    LAB221c SP26 FE_50.webp
    22.3 KB · Lượt xem: 1

Tạo tài khoản hoặc đăng nhập để bình luận

Bạn phải là thành viên mới có thể bình luận.

Tạo tài khoản

Hãy tạo tài khoản trên cộng đồng của chúng tôi. Thật dễ dàng!

Đăng nhập

Bạn đã có tài khoản? Đăng nhập tại đây.

Back
Top