The Artima Developer Community
Sponsored Link

Java Answers Forum
Static method calls

2 replies on 1 page. Most recent reply: Apr 11, 2002 4:35 AM by ssanjay

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
ssanjay

Posts: 3
Nickname: pssanjay
Registered: Apr, 2002

Static method calls Posted: Apr 10, 2002 1:08 PM
Reply to this message Reply
Advertisement
I have a class A and utility class B.B has all public static methods
which takes needed parameters( obj1,obj2 or obj3 ) to do validation checks on
passed objects.
System would be have more class like A (A1,A2 ...)and at run time there
will lot of objects like A,A1....
We never create object of B, all other objects call static methods on B
to get the validations done.

My question is, whether there will be any problem with threading/or
anything like that at run time. To make it more clear, if same method of
B is accessed by different objects of A at same time?

Thanks

Sanjay


Singh M.

Posts: 154
Nickname: ms
Registered: Mar, 2002

Re: Static method calls Posted: Apr 10, 2002 6:10 PM
Reply to this message Reply
problems might occur if your thread are trying to access shared data. eg. if you have some static variables (not final) in your class B, which the threads have access to, then you would need to synchronize access to that static data.

ssanjay

Posts: 3
Nickname: pssanjay
Registered: Apr, 2002

Re: Static method calls Posted: Apr 11, 2002 4:35 AM
Reply to this message Reply
Thanks.

Sanjay

Flat View: This topic has 2 replies on 1 page
Topic: SMS Previous Topic   Next Topic Topic: Word Frequency Help

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use