varibles of class type

Discussion in 'Java' started by asit, Jun 29, 2008.

  1. asit

    asit Guest

    when we create an object of class type, memory is allocated in the
    heap dynamically and a reference is passed to the class variable.

    1>where is that variable created ??What is the scope of that
    variable ???

    2>As java does not have global scope, the will be no global variable.
    So data memory in class programs remains unused. Is that so ???
    asit, Jun 29, 2008
    #1
    1. Advertising

  2. In article
    <>,
    asit <> wrote:

    > when we create an object of class type, memory is allocated in the
    > heap dynamically and a reference is passed to the class variable.
    >
    > 1> [W]here is that variable created? What is the scope of that
    > variable?
    >
    > 2> As java does not have global scope, the will be no global var-
    > iable. So data memory in class programs remains unused. Is that so?


    You can read more about (1a) Run-time Evaluation of Class Instance
    Creation Expressions, (1b) Scope of Local Variable Declarations, and (2)
    Finalization of Class Instances here:

    <http://java.sun.com/docs/books/jls/third_edition/html/j3TOC.html>

    --
    John B. Matthews
    trashgod at gmail dot com
    home dot woh dot rr dot com slash jbmatthews
    John B. Matthews, Jun 29, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DeeAnn
    Replies:
    4
    Views:
    7,633
  2. =?Utf-8?B?Q2hyaXM=?=

    Session varibles limit?

    =?Utf-8?B?Q2hyaXM=?=, Jan 9, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    2,710
    =?Utf-8?B?Q2hyaXM=?=
    Jan 10, 2005
  3. Replies:
    2
    Views:
    365
  4. Zhan feng Wang
    Replies:
    5
    Views:
    125
    Lloyd Linklater
    Aug 6, 2007
  5. ad
    Replies:
    5
    Views:
    320
    Uri Guttman
    May 30, 2004
Loading...

Share This Page