Re: a very tricky question...



On Mon, 23 Jun 2008 06:02:45 -0700 (PDT), "birensubudhi@xxxxxxxxx"
<birensubudhi@xxxxxxxxx> wrote, quoted or indirectly quoted someone
who said :

In java in object only the nonstatic members are present & the static
members donot reside in the object but we are accessing static members
using object reference technique.

since the static member do not reside in the object then how we are
accessing it using object reference...

That is a highly frowned on technique. At compile time the compiler
logically replaces a method reference with a static reference. The
compiler knows the Class of the reference.
--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
.



Relevant Pages

  • Re: Best way to use static method functions from MC++ lib in VB.NET
    ... class library DLLs automatically referenced by the Visual Studio .NET IDE. ... Certain project types add references to other .NET DLLs (such as the ... declare a "ConsoleEx" class with static members that were meant to augment ... > I create a reference to the library from a VB.NET application and I can ...
    (microsoft.public.dotnet.languages.vc)
  • Re: path error code, why?
    ... However, a function can pass back arbitrarily many values, via a variety of mechanisms, including the return value, passing variables by reference, and passing reference types by value, all of which can be used simultaneously. ... Some have "void" as the return type, ... you've declared local variables with the same name as the static members "percentuale" and "valore". ... This may be related to the previous issue, since the CalcolaPercentuale() function uses the static members; perhaps you meant to use the parameters "a" and "b" instead of the static members. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Is this thread safe?
    ... StringBuilder bld = new StringBuilder; ... StreamWriter sw = File.AppendText; ... The String class is immutable, so once the reference has been passed in, even if other threads are reading from the class, that wouldn't affect the thread executing this method. ... Getting the StreamWriter is thread-safe, with File.AppendTextbeing a static method and so falls under the "thread-safe" qualification for static members. ...
    (microsoft.public.dotnet.framework)
  • Re: What is the difference between class and type.
    ... Michael Borgwardt wrote: ... > That's not entirely true - with static members accessed through a reference ... Chris Smith - Lead Software Developer/Technical Trainer ...
    (comp.lang.java.programmer)