Question

Question 5 In the following method, describe which variables are thread-safe and which are not thread-safe and why. Not yet a

Please help me to answer the 5 programming questions and give some specific explanations, thanks a lot !!!

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution - In the above method variable stuff is not thread safe where as variable x,in,c is thread safe

Basically in java all the classes defined under  collection not thread-safe (except the Vector and Hashtable) therefore the arraylist stuff is not thread safe.

In java String class is thread safe as all the immutable object in Java are thread safe so the string variable here "String in" is thread safe.

Add a comment
Know the answer?
Add Answer to:
Please help me to answer the 5 programming questions and give some specific explanations, thanks a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please help me to answer the 5 programming questions and give some specific explanations, thanks a...

    Please help me to answer the 5 programming questions and give some specific explanations, thanks a lot !!! Question Consider a class hierarchy that includes a class called Creature, with subclasses called Unicorn and Dragon. The Creature class has a method called feelsLike, Not yet answered which is overridden in the Unicorn and Dragon class. Marked out of The feelsLike method of the Creature class returns "smooth", while the feelsLike method is overridden in the Unicorn class to return "fluffy"...

  • please answer all questions thanks Question 21 Not yet In a linked-node implementation of a ADT,...

    please answer all questions thanks Question 21 Not yet In a linked-node implementation of a ADT, node does not reference the data in another node answered Points out of 2.00 Select one: True P Flag question False Question 23 Not yet An array implementation of an ADT potentially wastes more space than a linked implementation answered Points out of 2.00 Select one: True P Flag question False Question 25 Should Node be a public class? Briefly explain Not yet answered...

  • Question 1 Not yet answered Marked out of 1.00 Flag question Question text Which of the...

    Question 1 Not yet answered Marked out of 1.00 Flag question Question text Which of the following keywords is useful for skipping to the next iteration of a loop? Select one: a. do b. break c. switch d. continue e. while Clear my choice Question 2 Not yet answered Marked out of 1.00 Flag question Question text Consider the following line of Java code. System.out.println("Hello, World!"); "out" is which of the following? Select one: a. a statement b. a class...

  • please give correct answers to these 6 questions, with explanations if possible. thankyou Which ionic compound...

    please give correct answers to these 6 questions, with explanations if possible. thankyou Which ionic compound will have the largest lattice Enthalpy? Which of the following diagrams depicts the d orbital? Question 1 Not yet answered Marked out of 1.00 P iagguestion Question 5 Not yet answered Marked out of 100 Select one: Flag question Select one: a BeCl2 b. Naci c . MgCl2 d. BeCl and MgCl2 will have the same lattice enthalpy values and they will be higher...

  • I need help on this Systems review please! it's due by midnight monday. Question 1 Not...

    I need help on this Systems review please! it's due by midnight monday. Question 1 Not yet answered Points out of 1.00 Flag question Question text Using these declarations: int * numberPointers[3]; int * pointer; int number; Which of the following statements would generate a warning or error? Select one: a. number = pointer; b. *pointer = number; c. pointer = numberPointers; d. numberPointers[2] = &number; e. a., b., and d. f. a. and c. Question 2 Not yet answered...

  • Pls help answer questions 1-5!! Which of these hormones could be taken orally? (multiple answers allowed)...

    Pls help answer questions 1-5!! Which of these hormones could be taken orally? (multiple answers allowed) Question 4 Not yet answered Marked out of 1.00 Select one or more: a. Estrogen b. Insulin Flag question c. T3/T4 O d. Biogenic amines Question 5 Which of the following would require a carrier protein to be soluble in the blood? Not yet answered Marked out of 1.00 Flag question Select one or more: O a. proteins/peptides O b. biogenic amines O c....

  • Given X 2T-QM making M the subject of the equation Question 5 Not yet answered Marked...

    Given X 2T-QM making M the subject of the equation Question 5 Not yet answered Marked out of 1.0 P Flag question we get Select one: O i. NONE OF THE OPTIONS GIVEN If 2x-1 3(3x - 5) then x- Question6 Not yet answered Marked out o 0 O i. none of the options P Flag question i. -2 17 Select one: If atbab Find -4 -9- Select one: Oi-25 O i. 7 O ii. None of the options Question...

  • i need some of help here for two questions pls if u answer me say (solution...

    i need some of help here for two questions pls if u answer me say (solution for Q Number 1) like this Question 1 Not yet answered Marked out of 7.50 P Flag question For each of the following situations involving marginal cost (MC) and marginal benefit (MB), indicate whether it would be best to produce more, fewer, or the current number of units. a. 3,000 units at which MC = $10 and MB = $13. b. 11 units at...

  • Help me with the workings to these questions please!!! Question 4 d when a 8.9, b...

    Help me with the workings to these questions please!!! Question 4 d when a 8.9, b 13.0 and c 7.8 will equal (correct to four decimal places) Not answered Marked out of 1.00 Flag question 4cr Answer: The correct answer is:0.0464 Question 5 Not answered Marked out of 1.00 ch For 3ry 2v-4,find at x 4.0 andy 4.3 (correct to four decimal places) Flag question Answer: The correct answer is: -1.6145 Question 6 Not answered Marked out of 1.00 units...

  • Not yet answered Marked out of 1.00 Flag question Question text What is the value of...

    Not yet answered Marked out of 1.00 Flag question Question text What is the value of the following Python expression? not(True and False) Select one: True False Question 2 Not yet answered Marked out of 1.00 Flag question Question text Consider the following Python program. fin = open('words.txt') for line in fin: word = line.strip() print(word) What does the program loop over? Select one: a. Lines in a file b. Lines in a list c. Words in a dictionary d....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT