ExamGecko
Question list
Search
Search

Related questions











Question 172 - H14-231_V1.0 discussion

Report
Export

A developer uses the threading function of HarmonyoS and writes the following code, which is the correct order of the execution result of the code?

TaskDispatcher globalTaskDispatcher =

getGlobalTaskDispatcher(TaskPriority.DEFAULT);

globalTaskDispatcher.syncDispatch(new

Runnable(){

@Override

public void run(){

HiLog.info (LABEL_LOG,'sync task1 run');//1

HiLog.info (LABEL_LOG, 'after sync task1');//2

globalTaskDispatcher.syncDispatch(new

Runnable(){

@0verride

pub1ic void run(){

HiLog.info(LABEL_LOG,'sync task2 run'); 3

}

});

HiLog.info (LABEL_LOG, 'after sync task2');//4

A.
2134
Answers
A.
2134
B.
1234
Answers
B.
1234
C.
2143
Answers
C.
2143
D.
4123
Answers
D.
4123
Suggested answer: B
asked 18/09/2024
Thomas Schmitt
42 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first