• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Object Creation

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All
I want to know

1) What happen when i create
a new object using new, i want to know what goes behind calling new

2) is static is thread safe

3) creating Static class and its performance in large application

4) i declared a class as final static is it necessary to declare member method of that class as final, if specify it as final what will pe effect on performance. In large scale system

Thanks
 
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Arvind Purohit wrote:What happen when i create a new object using new, i want to know what goes behind calling new


What do you mean by "what happen"? Why do you think this matters? How would this impact you? Chances are you shouldn't even really care about what happens, because it's dependent on the implementation anyway. Or did you mean something more basic?

Arvind Purohit wrote:is static is thread safe


Again, what do you mean by "safe"? What happened when you tried it?

Arvind Purohit wrote:creating Static class and its performance in large application


That's even less of a question than your other ones. What's the problem? What's your question?

Arvind Purohit wrote:i declared a class as final static is it necessary to declare member method of that class as final, if specify it as final what will pe effect on performance. In large scale system


And again, what happened when you tried it?

What did you find when you googled these questions?
You should probably read these:

Show Some Effort
Search First

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Arvind Purohit wrote:4) i declared a class as final static is it necessary to declare member method of that class as final, if specify it as final what will pe effect on performance. In large scale system


Are you even allowed to do that? Let's try:


Illegal modifier for the class impossible; only public, abstract & final are permitted
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

T Dahl wrote:

Arvind Purohit wrote:4) i declared a class as final static is it necessary to declare member method of that class as final, if specify it as final what will pe effect on performance. In large scale system


Are you even allowed to do that?


Yep:

And that partially answers Arvind's question: no you do not need to declare member methods to be final.
 
Barry's not gonna like this. Barry's not gonna like this one bit. What is Barry's deal with tiny ads?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic