Posted in JAVA EXAMPLE - GAJ

Đề thi java by exxamble mới nhất

1 A ____________ inherited by a sub-class has indirect access to all of the private members of the super class.

Derived class

Protected nested class

Extended class

2 The _________ internally creates a runtime system that helps the execution of code by loading the .class file, managing the memory, and performing garbage collection.

JVM

JDK

JBT

3 The ___________ method of the string class returns the index of the first occurrence of the specified character or string within a string.

Concat()

CharAt()

indexOf()

4 The _______ method of the StringTokenizer class returns true if there is atleast one token in the string after the current position

hasMoreTokens()

hasMoreElements()

countTokens()

5 The _________ allows an overriding method to return an object whose type is a sub-class of the type returned by the overridden method in the superclass.

Covariant return types

Method hiding

Method overloading

6 The _________ string class method returns the string representation of the specified argument.

valueOf()

toCharArray()

endsWith()

7 Constructor overloading can be achieved with (chọn nhiều câu)

Same number of parameters and different data types.
Different number of parameters with same data type.
Same number of parameters and data types
Different number of parameters with data types

8 The advantages of Instance Methods are:

1. Instance methods can be overridden and overloaded.
2. Overridden instance methods can have a different return type provided that the new type is a sub-class of the declared return type of the overridden method
3. Instance methods can only be accessed by using an instance of the class using the dot operator.
4. Static variables can be accessed from the instance methods.

Statement 1, 2, 3

Statement 2, 3, 4

Statements 1, 2, 3, 4

9 Learn Java By Example

A format specifier always starts with a percent sign. Which of the following is the syntax for a format specifier?

1. %[arg_index$] [flags] [width] [precision] conversion character
2. %[arg_index$] [flags] [width] [.precision] conversion character
3. %[arg_index$] [width] [.precision] conversion character
4. %[arg_index$] [flags] [.precision] conversion character

1

2

3

4

10 Learn Java By Example

When ______________ statements are used, there are no conflicts between the case constants in inner switch with those in the outer switch.

Embedded switch

Nested switch

Layered switch

Switch case

11 Learn Java By Example

What is a function of a while statement?

Test the result of the boolean expression

Avoid the conflicts between inner and outer switches

Repeat a block of code while the condition is true

12 Learn Java By Example

Java provides some statements that will change the flow of control based on conditions. __________ statement stops the execution of the innermost loop in the program and starts processing the next line of code after the block.

break

jump

continue

change

13 Learn Java By Example

The _______________ statement causes the current iteration of the innermost loop to cease and the next iteration of the same loop to start.

jump

iterate

cease

continue

14 Learn Java By Example

_______________ usually tests the loop control variable against a targeted value in a FOR statement.

boolean expression

iteration expression

initialization expression

15 Learn Java By Example

What is the function of a labeled statement?

To indicate the nested loop to continue with the next iteration.

To transfer the control directly to the conditional expression that controls the loop.

To stop the execution of the remaining body of the loop

16 Learn Java By Example

What is known as a base case?

Stopping recursion to save the memory

Calling a recursive method

Creating actual objects

Assigning values to element

17 Learn Java By Example

Every recursive method has some characteristics. When the method calls itself and pushes values on the stack, then this phase is known as ______________.

Recursive depth

Stack overflow

Endless recursion

Winding

18 Learn Java By Example

_______________ is an enumerated type with a fixed set of possible values and does not vary at the time of execution.

Dynamic enumerated type

Static enumerated type

Stable enumerated type

Still enumerated type

19 Learn Java By Example

_________________ indicates that the heap space they occupy needs to be recycled so that the space is available for subsequent new objects.

Garbage collection

Object creation

Recycle bin

Recycle heap

20 Learn Java By Example

You can keep track of the objects that are referenced by the executing program so as to finalize and free unreferenced objects by using _______________.

Compiler

Garbage Collected Heap

Java Virtual Machine

Stack

21 Learn Java By Example

________________ method returns the number of Unicode code points between two indices in the String.

codePointAt()

codePointBebore()

codePointCount()

startsWith()

22 Learn Java By Example

What is the function of valueOf()?

Converts the characters in the String to lower case.

Returns the string representation of the specified argument.

Copies the content of the String to a new character array.

Compares two strings and returns a boolean value.

23 Learn Java By Example

What is the function of gerChars()?

Returns the character value at the specified index.

Deletes a character at the specified position.

Copies specified number of character into an array

Returns the total number of characters from the StringBuilder object.

24 ________ is a process that converts an object’s internal state into a binary stream of bytes.

Package conversion

Method Modifier

Serialization

25 All ___________ in a class must be placed after the package statement and before the class declaration.

Import statements

Access specifiers

Method modifiers

mình vừa lấy được từ thằng bạn. bạn nào làm được thì cho mình cái đáp án nhé.

Tác giả:

Thích thì chiều sao phải xoắn :))

3 thoughts on “Đề thi java by exxamble mới nhất

  1. Đề thi java by exxamble mới nhất
    22THÁNG 6
    1 A ____________ inherited by a sub-class has indirect access to all of the private members of the super class.
    Derived class
    Protected nested class (toi chon)
    Extended class
    2 The _________ internally creates a runtime system that helps the execution of code by loading the .class file, managing the memory, and performing garbage collection.
    JVM
    JDK (toi chon)
    JBT
    3 The ___________ method of the string class returns the index of the first occurrence of the specified character or string within a string.
    Concat()
    CharAt()
    indexOf() (tôi chọn)
    4 The _______ method of the StringTokenizer class returns true if there is atleast one token in the string after the current position
    hasMoreTokens()(tôi chọn)
    hasMoreElements()
    countTokens()
    5 The _________ allows an overriding method to return an object whose type is a sub-class of the type returned by the overridden method in the superclass.
    Covariant return types (toi chon)
    Method hiding
    Method overloading
    6 The _________ string class method returns the string representation of the specified argument.
    valueOf() (tôi chọn)
    toCharArray()
    endsWith()
    7 Constructor overloading can be achieved with (chọn nhiều câu)
    Same number of parameters and different data types. (tôi chọn)
    Different number of parameters with same data type. (tôi chọn)
    Same number of parameters and data types
    Different number of parameters with data types(tôi chọn)
    8 The advantages of Instance Methods are:
    1. Instance methods can be overridden and overloaded.
    2. Overridden instance methods can have a different return type provided that the new type is a sub-class of the declared return type of the overridden method
    3. Instance methods can only be accessed by using an instance of the class using the dot operator.
    4. Static variables can be accessed from the instance methods.
    Statement 1, 2, 3
    Statement 2, 3, 4
    Statements 1, 2, 3, 4
    9 Learn Java By Example
    A format specifier always starts with a percent sign. Which of the following is the syntax for a format specifier?
    1. %[arg_index$] [flags] [width] [precision] conversion character
    2. %[arg_index$] [flags] [width] [.precision] conversion character
    3. %[arg_index$] [width] [.precision] conversion character
    4. %[arg_index$] [flags] [.precision] conversion character
    1
    2
    3
    4
    10 Learn Java By Example
    When ______________ statements are used, there are no conflicts between the case constants in inner switch with those in the outer switch.
    Embedded switch
    Nested switch (toi chon)
    Layered switch
    Switch case
    11 Learn Java By Example
    What is a function of a while statement?
    Test the result of the boolean expression
    Avoid the conflicts between inner and outer switches
    Repeat a block of code while the condition is true
    12 Learn Java By Example
    Java provides some statements that will change the flow of control based on conditions. __________ statement stops the execution of the innermost loop in the program and starts processing the next line of code after the block.
    Break (tôi chọn)
    jump
    continue
    change
    13 Learn Java By Example
    The _______________ statement causes the current iteration of the innermost loop to cease and the next iteration of the same loop to start.
    jump
    iterate
    cease
    continue(tôi chọn)
    14 Learn Java By Example
    _______________ usually tests the loop control variable against a targeted value in a FOR statement.
    boolean expression(tôi chọn)
    iteration expression
    initialization expression
    15 Learn Java By Example
    What is the function of a labeled statement?
    To indicate the nested loop to continue with the next iteration.
    To transfer the control directly to the conditional expression that controls the loop. (tôi chọn)
    To stop the execution of the remaining body of the loop
    16 Learn Java By Example
    What is known as a base case?
    Stopping recursion to save the memory
    Calling a recursive method
    Creating actual objects
    Assigning values to element
    17 Learn Java By Example
    Every recursive method has some characteristics. When the method calls itself and pushes values on the stack, then this phase is known as ______________.
    Recursive depth
    Stack overflow
    Endless recursion
    Winding
    18 Learn Java By Example
    _______________ is an enumerated type with a fixed set of possible values and does not vary at the time of execution.
    Dynamic enumerated type
    Static enumerated type (toi chon)
    Stable enumerated type
    Still enumerated type
    19 Learn Java By Example
    _________________ indicates that the heap space they occupy needs to be recycled so that the space is available for subsequent new objects.
    Garbage collection (tôi chọn)
    Object creation
    Recycle bin
    Recycle heap
    20 Learn Java By Example
    You can keep track of the objects that are referenced by the executing program so as to finalize and free unreferenced objects by using _______________.
    Compiler
    Garbage Collected Heap (toi chon )
    Java Virtual Machine
    Stack
    21 Learn Java By Example
    ________________ method returns the number of Unicode code points between two indices in the String.
    codePointAt() (toi chon)
    codePointBebore()
    codePointCount()
    startsWith()
    22 Learn Java By Example
    What is the function of valueOf()?
    Converts the characters in the String to lower case.
    Returns the string representation of the specified argument. (tôi chọn)
    Copies the content of the String to a new character array.
    Compares two strings and returns a boolean value.
    23 Learn Java By Example
    What is the function of gerChars()?
    Returns the character value at the specified index.
    Deletes a character at the specified position.
    Copies specified number of character into an array(tôi chọn)
    Returns the total number of characters from the StringBuilder object.
    24 ________ is a process that converts an object’s internal state into a binary stream of bytes.
    Package conversion
    Method Modifier
    Serialization (toi chon)
    25 All ___________ in a class must be placed after the package statement and before the class declaration.
    Import statements
    Access specifiers(tôi chọn)
    Method modifiers

Gửi phản hồi

Mời bạn điền thông tin vào ô dưới đây hoặc kích vào một biểu tượng để đăng nhập:

WordPress.com Logo

Bạn đang bình luận bằng tài khoản WordPress.com Log Out / Thay đổi )

Twitter picture

Bạn đang bình luận bằng tài khoản Twitter Log Out / Thay đổi )

Facebook photo

Bạn đang bình luận bằng tài khoản Facebook Log Out / Thay đổi )

Google+ photo

Bạn đang bình luận bằng tài khoản Google+ Log Out / Thay đổi )

Connecting to %s