Create a while loop that iterates until a specific condition is met inside the loop
Inside the loop, ask the user to enter a grade. If the grade is smaller than 0, stop the loop. Otherwise, add the grade to the total and increment the count by 1.
When the loop is done, calculate the average, divide the total by count, and print it
Synchronized method is used to lock an object for any shared resource. When a thread invokes a synchronized method, it automatically acquires the lock for that object and releases it when the thread completes its task.','.