Shadowing Practice: ๐Ÿ”ฅ Java Multithreading Rapid Fire | Can You Answer These Interview Questions? #shorts - Learn English Speaking with Video

ื‘ื—ืจ ืžืฆื‘ ืชืจื’ื•ืœ

ื›ืœ ืžืฆื‘ ืคื•ืชื— ื—ื“ืจ ืชืจื’ื•ืœ ื‘ืžืกืš ืžืœื.

26 ืžืฉืคื˜ื™ื
ืื ื”ืžืฉืคื˜ื™ื ืงืฆืจื™ื ืื• ืืจื•ื›ื™ื ืžื“ื™, ืœื—ืฅ ืขืœ ืขืจื•ืš ื›ื“ื™ ืœื”ืชืื™ื ืื•ืชื.
1
What is multi -threading?
2
Multi -threading means performing multiple tasks in parallel.
3
This is done using threads.
4
Thread is basically a small unit that performs some tasks inside your application.
5
Suppose you want to perform three tasks in parallel, you can create three threads and each thread can perform one task.
6
How do you create a thread in Java?
7
There are mainly two ways.
8
Either extend a class named Thread or implement an interface named Runnable.
9
Explain the first approach.
10
We extend the thread class and override its run method.
11
Whatever task we want the thread to perform, we write inside run.
12
Then we create an object of our task class.
13
Using this object we call the start method.
14
What is the difference between start and run?
15
Start creates a new thread and then internally executes run.
16
Calling run directly does not create a new thread.
17
Explain the second approach.
18
We implement the runnable interface and override its run method.
19
Runnable only has run, it does not have start.
20
So we can't call start directly using the task object.
21
Hence we create a thread object and pass the task object to its constructor.
22
This thread object then calls start.
23
What was the need for this approach?
24
Its needed because Java does not support multiple inheritance.
25
Suppose our task class already extends another class then it won't be able to extend thread
26
but it can still implement runnable that is allowed.

ื”ื•ืจื“ ืืคืœื™ืงืฆื™ื”

ื›ืœ ืžื” ืฉืืชื” ืฆืจื™ืš ื›ื“ื™ ืœื“ื‘ืจ ื‘ืฉื˜ืฃ

ื”ื’ื™ื™ืช AIืฆื™ื•ืŸ ืœื›ืœ ืžืฉืคื˜
ืชืจื’ื•ืœ IPAืฉืœื•ื˜ ื‘ื›ืœ ืฆืœื™ืœ
ืื•ืฆืจ ืžื™ืœื™ืื‘ื ื” ืืช ืžืื’ืจ ื”ืžื™ืœื™ื ืฉืœืš
ืžืฉื—ืง ืื•ืฆืจ ืžื™ืœื™ืืœืžื“ ืชื•ืš ื›ื“ื™ ืžืฉื—ืง

ืื•ืชื• ืขืจื•ืฅ

FOR YOU

ื”ืžืœืฅ ืขืœ ืกืจื˜ื•ืŸ

ืื•ืฆืจ ืžื™ืœื™ื ื•ื”ืขืจื•ืช ื”ื’ื™ื™ื” ืœืฉื™ืขื•ืจ ื”ื–ื”

ืฉื™ืขื•ืจ ื”ื“ื™ื‘ื•ืจ ื”ื–ื” ื‘ืจืžื” C1 ืžื‘ื•ืกืก ืขืœ ื”ืกืจื˜ื•ืŸ โ€œ๐Ÿ”ฅ Java Multithreading Rapid Fireโ€. ื”ืžื™ืœื™ื ืฉื—ื•ื–ืจื•ืช ื”ื›ื™ ื”ืจื‘ื”: thread, task, object, create, runnable. ื‘ืกืจื˜ื•ืŸ ื”ื–ื” ื™ืฉ 26 ืžืฉืคื˜ื™ื ื•-240 ืžื™ืœื™ื ืœืชืจื’ื•ืœ Shadowing. ื”ื“ื™ื‘ื•ืจ ื ืžืฉืš 1:19. ื”ื“ื•ื‘ืจ ืžื“ื‘ืจ ืžื”ืจ, ื›-182 ืžื™ืœื™ื ื‘ื“ืงื”, ืื– ืฆืคื• ืœืฆืœื™ืœื™ื ืžื—ื•ื‘ืจื™ื ื•ืžืงื•ืฆืจื™ื. ืจืง 79% ืžื”ืžื™ืœื™ื ื ืžืฆืื•ืช ื‘ื™ืŸ 3,000 ื”ืžื™ืœื™ื ื”ื ืคื•ืฆื•ืช ื‘ื™ื•ืชืจ ื‘ืื ื’ืœื™ืช, ื›ืš ืฉืื•ืฆืจ ื”ืžื™ืœื™ื ืžืืชื’ืจ. 4 ืžืชื•ืš 26 ื”ืžืฉืคื˜ื™ื ืฉืœื• ื”ื ืฉืืœื•ืช, ื›ืš ืฉื–ื” ืชืจื’ื•ืœ ื˜ื•ื‘ ืœืื™ื ื˜ื•ื ืฆื™ื” ืฉืœ ืฉืืœื•ืช ื•ืœืชืฉื•ื‘ื•ืช ืงืฆืจื•ืช.

ืื•ืฆืจ ืžื™ืœื™ื ืžืจื›ื–ื™ ื‘ืกืจื˜ื•ืŸ ื”ื–ื”

11 ื”ืžื™ืœื™ื ื”ืžืชืงื“ืžื•ืช ื‘ื™ื•ืชืจ ื‘ืกืจื˜ื•ืŸ, ืขื ื”ื”ื’ื™ื™ื” ื•ื”ืžืฉืžืขื•ืช ืฉืœื”ืŸ:

ืžื™ืœื”ื”ื’ื™ื™ื”ืžืฉืžืขื•ืช
thread ืฉื ืขืฆื/หˆฮธษนษ›d/ื—ื•ึผื˜
implement ืคื•ืขืœ/หˆษชmplษ™mษ™nt/ื™ื™ืฉื, ืžื™ืžืฉ
parallel ืฉื ืชื•ืืจ/หˆpรฆ.ษนษ™หŒlษ›l/ืžืงื‘ื™ืœ
interface ืฉื ืขืฆื/หˆษชn(t)ษšหŒfeษชs/ืžึดืžึฐืฉึธืืง
hence ืชื•ืืจ ื”ืคื•ืขืœ/หˆhษ›ns/ืžื›ืืŸ
execute ืคื•ืขืœ/หˆษ›ksษชหŒkjuหt/ืœื”ื•ืฆื™ื ืœื”ืจื•ื’
task ืฉื ืขืฆื/tรฆsk/ืžึฐืฉึดื‚ื™ืžึธื”, ืžึทื˜ึธึผืœึธื”
object ืฉื ืขืฆื/หˆษ‘b.dอกส’ษ›kt/ืื•ึนื‘ึฐึผื™ึถืงึฐื˜, ื—ึตืคึถืฅ
suppose ืคื•ืขืœ/sษ™หˆpoสŠz/ื”ึตื ึดื™ื—ึท
basically ืชื•ืืจ ื”ืคื•ืขืœ/หˆbeษช.sษชk.(ษ™.)li/ืขึถืงึฐืจื•ึนื ึดื™ืช
mainly ืชื•ืืจ ื”ืคื•ืขืœ/หˆmeษชnli/ื‘ืขื™ืงืจ \ ื‘ึฐึผืขึดืงึธึผืจ

ื”ื’ื™ื™ื” ืฉืฉื•ื•ื” ืœืฉื™ื ืœื‘ ืืœื™ื”

  • ืžื™ืœื™ื ืืจื•ื›ื•ืช โ€” ืฉื™ืžื• ืœื‘ ืœื”ื˜ืขืžื”: inheritance /ษชnหˆhษ›ษนษชtษ™ns/, internally /ษชnหˆtษœหnษ™li/, basically /หˆbeษช.sษชk.(ษ™.)li/

ืฆืœื™ืœื™ื ืฉื“ื•ื‘ืจื™ ืขื‘ืจื™ืช ืžืชืงืฉื™ื ื‘ื”ื:

  • /รฆ/ โ€” ืคืชื•ื— ื™ื•ืชืจ ืžื”-โ€œืึถโ€ ื”ืขื‘ืจื™ืช, ืœื ื›ืžื• โ€œaโ€ ื‘-โ€œcupโ€: parallel /หˆpรฆ.ษนษ™หŒlษ›l/, task /tรฆsk/
  • /r/ โ€” ื”ืœืฉื•ืŸ ืœื ื ื•ื’ืขืช ื‘ืฉื•ื ืžืงื•ื, ืœื ื”-โ€œืจโ€ ื”ื’ืจื•ื ื™ืช: thread /หˆฮธษนษ›d/, parallel /หˆpรฆ.ษนษ™หŒlษ›l/, inheritance /ษชnหˆhษ›ษนษชtษ™ns/, override /oสŠ.vษšหˆษนaษชd/
  • ืขื™ืฆื•ืจ ืงื•ืœื™ ื‘ืกื•ืฃ ืžื™ืœื” โ€” /b/, /d/, /g/, /z/, /v/ ื‘ืœื™ ืœื”ืคื•ืš ืื•ืชื ืœืื˜ื•ืžื™ื: thread /หˆฮธษนษ›d/, extend /ษ›kหˆstษ›nd/, override /oสŠ.vษšหˆษนaษชd/, suppose /sษ™หˆpoสŠz/

ืื™ืš ืœืชืจื’ืœ ืขื ื”ืกืจื˜ื•ืŸ ื”ื–ื”

  1. ื”ืงืฉื™ื‘ื• ืœื›ืœ ื”ืกืจื˜ื•ืŸ ืคืขื ืื—ืช ื‘ืœื™ ืœื“ื‘ืจ, ื•ืจืฉืžื• ืืช ื”ืžื™ืœื™ื ืฉืืชื ืœื ืžื›ื™ืจื™ื.
  2. ื”ืชื—ื™ืœื• ื‘ืžื”ื™ืจื•ืช 0.75ร—, ืชืจื’ืœื• Shadowing ืžืฉืคื˜ ืื—ืจ ืžืฉืคื˜, ื•ื—ื–ืจื• ืœืžื”ื™ืจื•ืช ืจื’ื™ืœื” ื›ืฉื–ื” ืžืจื’ื™ืฉ ืงืœ.
  3. ื”ืงืœื™ื˜ื• ืืช ืขืฆืžื›ื ื•ื”ืฉื•ื• ืœืžืงื•ืจ, ืชื•ืš ืชืฉื•ืžืช ืœื‘ ืœืžื™ืœื™ื ื›ืžื• thread, implement, parallel.

ืžื”ื™ ื˜ื›ื ื™ืงืช ื”ืฉืื“ื•ืื™ื ื’?

ืฉืื“ื•ืื™ื ื’ ื”ื™ื ื˜ื›ื ื™ืงืช ืœืžื™ื“ืช ืฉืคื” ืžื‘ื•ืกืกืช ืžื“ืข ืฉืคื•ืชื—ื” ื‘ืžืงื•ืจ ืœื”ื›ืฉืจืช ืžืชื•ืจื’ืžื ื™ื ืžืงืฆื•ืขื™ื™ื ื•ืคื•ืคื•ืœืจื™ืช ืขืœ ื™ื“ื™ ื”ืคื•ืœื™ื’ืœื•ื˜ ื“"ืจ ืืœื›ืกื ื“ืจ ืืจื’ื•ืืœืก. ื”ืฉื™ื˜ื” ืคืฉื•ื˜ื” ืืš ืขื•ืฆืžืชื™ืช: ืืชื” ืžืงืฉื™ื‘ ืœืื•ื“ื™ื• ื‘ืื ื’ืœื™ืช ื™ืœื™ื“ื™ืช ื•ื—ื•ื–ืจ ืขืœื™ื• ื‘ืงื•ืœ ืจื ืžื™ื“ โ€” ื›ืžื• ืฆืœ ื”ืขื•ืงื‘ ืื—ืจื™ ื”ื“ื•ื‘ืจ ืขื ืขื™ื›ื•ื‘ ืฉืœ 1โ€“2 ืฉื ื™ื•ืช ื‘ืœื‘ื“. ื‘ื ื™ื’ื•ื“ ืœื”ืื–ื ื” ืคืกื™ื‘ื™ืช ืื• ืชืจื’ื™ืœื™ ื“ืงื“ื•ืง, ืฉืื“ื•ืื™ื ื’ ืžื›ืจื™ื— ืืช ื”ืžื•ื— ื•ื”ืฉืจื™ืจื™ื ื‘ืคื” ืœืขื‘ื“ ื•ืœืฉื—ื–ืจ ื“ืคื•ืกื™ ื“ื™ื‘ื•ืจ ืืžื™ืชื™ื™ื ื‘ื• ื–ืžื ื™ืช. ืžื—ืงืจื™ื ืžืจืื™ื ืฉื–ื” ืžืฉืคืจ ืžืฉืžืขื•ืชื™ืช ืืช ื“ื™ื•ืง ื”ื”ื’ื™ื™ื”, ื”ืื™ื ื˜ื•ื ืฆื™ื”, ื”ืงืฆื‘, ื”ื“ื™ื‘ื•ืจ ื”ืžื—ื•ื‘ืจ, ื”ื‘ื ืช ื”ืฉืžื™ืขื” ื•ืฉื˜ืฃ ื”ื“ื™ื‘ื•ืจ โ€” ืžื” ืฉื”ื•ืคืš ืื•ืชื• ืœืื—ืช ื”ืฉื™ื˜ื•ืช ื”ื™ืขื™ืœื•ืช ื‘ื™ื•ืชืจ ืœื”ื›ื ื” ืœIELTS Speaking ื•ืœืชืงืฉื•ืจืช ื‘ืื ื’ืœื™ืช ื‘ืขื•ืœื ื”ืืžื™ืชื™.

ื˜ื›ื ื™ืงืช Shadowing: ืงืจื ืืช ื”ืžื“ืจื™ืš ื”ืžืœื ืฉืœื‘ ืื—ืจ ืฉืœื‘ โ†’