• 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

May be silly question!!

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

It may seems o be a silly question. But, I don't know whom to ask. I have the only source "JAVARANCH".

Often, I come across like this.

Given a program and asking the following questions frequently in the String cases)

Say that the program has just been loaded into main memory and is just about to start running.
How many reference variables are there?
How many objects are there?


Whether it is possible to write the program or already having the program to test the above question.

If we have like this, we can check our pgm, how many objects are created and how many refernces are there?
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There aren't silly questions, just silly people.

Actually the best place to find that answer is in the Java Langauge Specification and in the section it talks about the class loader and the JVM how it starts up.

But basically, and this is just a stab, since i never try to memorize this trivia stuff. But the program is starting up, so that it is calling the main method which is static, and does not need an instance. Therefore I would say there are no instance objects created, and therefore also no instance variables created.

But the JVM might have something underneath that only the JLS (Java Spec) will tell you about.

JLS is at java.sun.com

Mark
 
You have to be odd to be #1 - Seuss. An odd little ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic