Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the interview questions in the Java written examination?

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what are the interview questions for the Java written examination". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what are the interview questions for the Java written examination"?

Which of the following statements is true ()

a. The subclass inherits the constructor of the parent class.

Subclasses of the B.abstract class must be non-abstract classes.

c. Methods inherited by subclasses can only manipulate member variables that are inherited and hidden by subclasses.

d. Subclass overrides or new methods can also directly manipulate member variables hidden by subclasses.

Click on the blank area below to view the answer analysis!

Correct answer: C

Answer parsing: the subclass does not inherit the constructor of the parent class, but must call the constructor of its parent class. The subclass of the abstract class can be an abstract class, and if it is a non-abstract class, all abstract methods in the parent class must be overridden. The new method of the D subclass cannot directly manipulate the hidden member variables of the quilt subclass.

The concurrency mechanism of Java programs is ()

a. Multithreading

b. Multi-interface

c. Multi-platform

d. Polymorphisms

Click on the blank area below to view the answer analysis!

Correct answer: a

Answer Analysis: Java implements the concurrency mechanism through multithreading. Multithreading means that a program contains multiple execution streams. The meaning of multithreaded programming is that program tasks can be divided into several parallel subtasks.

Among the following options, those that do not belong to inter-module coupling are ()

a. Data coupling

b. Label coupling

c. Heterogeneous coupling

d. Common coupling

Click on the blank area below to view the answer analysis!

Correct answer: C

Answer analysis:

The degree of coupling between modules reflects the independence of modules and the complexity of the system after decomposition. According to the degree of coupling from weak to strong, it can be divided into seven levels.

They are indirect coupling, data coupling, label coupling, control coupling, external coupling, common coupling and content coupling. There is no such way of heterogeneous coupling. In order to make the module as independent as possible, ()

A. the degree of cohesion of the module should be as high as possible and the degree of coupling should be as strong as possible.

B. the degree of cohesion of the module should be as high as possible, and the degree of coupling should be as weak as possible.

C. the degree of cohesion of modules should be as low as possible, and the degree of coupling should be as weak as possible.

D. the degree of cohesion of the module should be as low as possible and the degree of coupling should be as strong as possible.

Click on the blank area below to view the answer analysis!

Correct answer: B

The quality of the system design is mainly reflected in the independence of the module. There are two main criteria to evaluate the independence of modules: one is the coupling between modules, which indicates the degree of independence between the two modules; the other is whether the internal relationship between modules is close, which is called cohesion. Generally speaking, the coupling between modules is required to be as weak as possible, that is, the modules are as independent as possible, and the degree of cohesion of modules is required to be as high as possible.

The following statement about the mixed use of modifiers is wrong ()

A.abstract cannot decorate the same class side by side with final

You cannot have members of private in the B.abstract class

The C.abstract method must be in the abstract class

D.static method can deal with non-static data

Click on the blank area below to view the answer analysis!

Correct answer: d

Answer analysis: static methods belong to classes, while ordinary methods belong to objects. Static methods that belong to a class can be accessed when the object does not exist, while ordinary methods must new an object before it can be accessed with that object. When we access and call a static method (use the class name. Static method name) there is no object creation at this time, so ordinary methods are not accessible. To avoid this error, java does not allow access to non-static methods in static methods.

At this point, I believe you have a deeper understanding of "what are the interview questions for the Java written examination?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report