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"...

  • 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 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...

  • 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...

  • 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....

  • 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...

  • Please help me answer these questions in java programming language. Please answer it line after line...

    Please help me answer these questions in java programming language. Please answer it line after line so that I can understand please. Does it compile or not? No programming is done in this exercise, simply answer the questions asked in the code given below. class Exemple { /*Explain why this code does not compile */ public void m1() { foo(); } public int foo() throws Exception { throw new Exception(); } /*Explain why this code is not considered as good...

  • 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....

  • Please answer both questions. Thanks Question 24 (1 point) What value would be returned if the...

    Please answer both questions. Thanks Question 24 (1 point) What value would be returned if the method mystery were called and passed the array values (1, 15, 37, 12) as its parameter? public static int mystery (int[] list) int x = 0; for (int i = 1; i < list.length; i++) { int y = list[i] - list [0]; if (y > x) x = Y } } return x; 29 35 1 36 Question 25 (1 point) What is...

  • please answer me this Consider a membrane protein destined for the plasma membrane. From a hydropathy...

    please answer me this Consider a membrane protein destined for the plasma membrane. From a hydropathy plot, you determine the protein has the following general structural elements: • • • 5 Trans-membrane domains (boxes 1-5) 6 soluble domains (wavy lines A-F) Flanking charges around trans-membrane domain 1. (A positive charge is towards the N-terminus, and a negative charge is towards the C-terminus.) You find that soluble domains B and E contain possible glycosylation sites. Ntorm in an ammo u arom...

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