

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Java programs for the academic year 2024
Typology: Lab Reports
1 / 2
This page cannot be seen from the preview
Don't miss anything!
To implement the concept of multithreading with the use of any three multiplication tables and assign three different priorities to them. ALGORITHM: Step 1: Start the process Step 2: Define three thread classes A, B, and C, each implementing run() method with different multiplication ranges and end messages. Step 3: Set threadA to MAX_PRIORITY, threadB to NORM_PRIORITY, and threadC to MIN_PRIORITY. Step 4: Start threadA and wait for threadA to finish Step 5: Start threadB,join Thread B and start Thread C, and join Thread C Step 6: Wait for threadB to finish, then start threadC and wait for it to finish Step 7: Handle any InterruptedException by printing an error message and re-interrupting the current thread.
To draw several shapes in the created window. ALGORITHM: Step 1: Create ShapeDrawer class extending JPanel. Step 2: Implement paintComponent to draw shapes and text. Step 3: Draw a green circle, pink ellipse, magenta square, and blue rectangle with respective labels Step 4: Instantiate JFrame with title "Shape Drawer". Step 5: Create an instance of ShapeDrawer. Step 6: Configure JFrame to close on exit, set size, and add the ShapeDrawer panel. Step 7: Display the JFrame.