CodeGym/Java Course/Java உள்ளகம்/போனஸ் டாஸ்க் | பாடம் 13 | நிலை 6

போனஸ் டாஸ்க் | பாடம் 13 | நிலை 6

கிடைக்கப்பெறுகிறது

"ஏ, சிப்பாய்!"

"நல்ல நாள், கேப்டன்!"

"உங்களுக்காக எனக்கு அற்புதமான செய்திகள் கிடைத்துள்ளன. உங்கள் திறமைகளை வலுப்படுத்துவதற்கான சில பயிற்சிகள் இங்கே உள்ளன. அவற்றை ஒவ்வொரு நாளும் செய்யுங்கள், உங்கள் திறமைகள் அபத்தமான வேகத்தில் வளரும். அவை குறிப்பாக IntelliJ IDEA க்காக உருவாக்கப்பட்டவை."

"அந்த முந்தைய பயிற்சிகள் புதுமுக வீரர்களுக்கானது. நான் பழைய-டைமர்களுக்காக இன்னும் சில மேம்பட்ட போனஸ் பயிற்சிகளைச் சேர்த்துள்ளேன். அனுபவமிக்கவர்களுக்காக மட்டுமே."

4
பணி
Java Core,  நிலை 6பாடம் 13
பூட்டப்பட்டது
Thread.currentThread always returns the current thread
1. In the printMsg method, assign the current thread to the variable t. 2. In the printMsg method, add a delay of 1 millisecond after all the actions.
4
பணி
Java Core,  நிலை 6பாடம் 13
பூட்டப்பட்டது
Consecutive threads
1. In the run method, add a delay of 10 milliseconds after all the actions. Display "Thread interrupted" if the thread is interrupted. 2. Make all the threads run sequentially: first, for thread 1, count down from COUNT to 1; then for thread 2 - from COUNT to 1, etc. Example: #1: 4 #1: 3 ... #1: 1 #
18
பணி
Java Core,  நிலை 6பாடம் 13
பூட்டப்பட்டது
Creating threads recursively
1. Change the GenerateThread class to make it a thread. 2. Create a GenerateThread constructor, which must: 2.1. Call the superclass's constructor, passing the created thread's number as a String. Use createdThreadCount. 2.2. Start the current thread. 2.3. The thread numbers must start with 1. 3. O
4
பணி
Java Core,  நிலை 6பாடம் 13
பூட்டப்பட்டது
Consecutive threads
1. Figure out what the program does. 2. Make the program first display the result of the thread, and when the thread has finished then the main method continues. 3. Example output: inside MyThread 0 inside MyThread 1 ... inside MyThread 9 inside main 0 inside main 1 ... inside main 9
4
பணி
Java Core,  நிலை 6பாடம் 13
பூட்டப்பட்டது
Deadlock
1. Figure out how the program works. 2. Without changing the T1 and T2 classes, make it so their threads finish (not necessarily successfully). 3. Don't use the sleep method.
9
பணி
Java Core,  நிலை 6பாடம் 13
பூட்டப்பட்டது
Following a pattern
Figure out how the program works. Similar to CountdownRunnable, create a CountUpRunnable thread that displays values ​​in the counting order: from 1 to number.
18
பணி
Java Core,  நிலை 6பாடம் 13
பூட்டப்பட்டது
Shall we play?
Three people play the game. Each player (Gamer) is characterized by two parameters: last name (name) and the actions-per-second (rating). Display the actions taken and determine the winner and the losers. Let's begin... 1. Figure out what the program does. 1.1. List actions stores the sequen
18
பணி
Java Core,  நிலை 6பாடம் 13
பூட்டப்பட்டது
The early bird gets the worm
1. Figure out what the program does. 1.1. Each thread should read lines from the console. Use the existing static BufferedReader reader. 1.2. Use AtomicInteger readStringCount to calculate how many lines all the threads have read from the console. 2. Implement the run method: 2.1. As long as a thr
9
பணி
Java Core,  நிலை 6பாடம் 13
பூட்டப்பட்டது
Take your turn!
1. In the Solution class, create a public static Read3Strings class that inherits Thread. 2. In the run method, read three lines from the console. 3. Three lines should be read in succession on one thread and combined into one space-delimited string. 4. In the main method, display the result for eac
18
பணி
Java Core,  நிலை 6பாடம் 13
பூட்டப்பட்டது
Sequential file output
1. Figure out what the program does. 2. In a static block, read 2 filenames: firstFileName and secondFileName. 3. Inside the Solution class, create a public static ReadFileThread class that implements the ReadFileInterface interface (Think about what is more appropriate: Thread or Runnable). 3.1. Th
18
பணி
Java Core,  நிலை 6பாடம் 13
பூட்டப்பட்டது
Factory method pattern
1. Take a careful look at the classes you have. 2. In separate files in the common package, create JpgReader, PngReader, and BmpReader classes that implement the ImageReader interface. 3. In a separate file in the main package, create the ImageReaderFactory class with one method. 3.1. Think about wh
18
பணி
Java Core,  நிலை 6பாடம் 13
பூட்டப்பட்டது
Clew
1. Create 5 different threads that differ from Thread: 1.1. Thread 1 must run indefinitely; 1.2. Thread 2 should display "InterruptedException" when an InterruptedException occurs; 1.3. Thread 3 should display "Hurray" every half second"; 1.4. Thread 4 must implement the Message interface. When the
18
பணி
Java Core,  நிலை 6பாடம் 13
பூட்டப்பட்டது
Debug everything under the sun
Figure out what the program does. Read about UncaughtExceptionHandler - it's important. Take another careful look at the program. Figure out why our OurUncaughtExceptionHandler doesn't work (use the debugger). Fix the bug, i.e. everything should work. :) Expected result in no particular order: Thre
கருத்துக்கள்
  • பிரபலமானவை
  • புதியவை
  • பழையவை
ஒரு கருத்தைத் தெரிவிக்க நீங்கள் உள்நுழைந்திருக்க வேண்டும்
இந்தப் பக்கத்தில் இதுவரை எந்தக் கருத்தும் வழங்கப்படவில்லை