Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #18409

Re: startup code

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date Wed, 29 Aug 2012 13:58:33 -0500
Date Wed, 29 Aug 2012 11:58:35 -0700
From Patricia Shanahan <pats@acm.org>
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0
MIME-Version 1.0
Newsgroups comp.lang.java.programmer
Subject Re: startup code
References <9b4cce4e-99b1-414f-a033-1acf9200e90a@googlegroups.com> <2r4q38p3790lc86fpttn4arc58m5m1tjen@4ax.com> <3926176c-0940-4080-95a1-fb67bbbec50e@googlegroups.com> <aa4sm3FtuvU1@mid.individual.net> <c9e3596e-4091-4661-943a-a62f7e1ac4e0@googlegroups.com> <DdmdnV3jtJyVqKPNnZ2dnUVZ_jCdnZ2d@earthlink.com> <2667fee7-d27c-4d64-8fcc-501c188a2d33@googlegroups.com>
In-Reply-To <2667fee7-d27c-4d64-8fcc-501c188a2d33@googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Message-ID <wN6dnbtMWafH-6PNnZ2dnUVZ_rOdnZ2d@earthlink.com> (permalink)
Lines 34
X-Usenet-Provider http://www.giganews.com
NNTP-Posting-Host 70.230.200.172
X-Trace sv3-qwTjHGZvY0dY4xzfzHJ68VpBLdLYYI68sOLl7fX9MdCXP0mZEXre0LKmw/xEicP6WJubtEVXsVO80F2!8WmglJrmH8pDz3GYNbphB8kdOMdzs3/aoVJ2bxsGU6txL01HSeBOY/AWxhXIqd23O1ADVLi79JlT!Vje7R8C075k7pCpay5UW3C8eBhpmsrmL0w4DMzc5hLzbHLA=
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 2273
Xref csiph.com comp.lang.java.programmer:18409

Show key headers only | View raw


On 8/29/2012 11:18 AM, bob smith wrote:
> On Wednesday, August 29, 2012 10:28:09 AM UTC-5, Patricia Shanahan wrote:
>> On 8/29/2012 8:14 AM, bob smith wrote:
>>
>> ...
>>
>>> I have a font class, and it needs to load a bitmap containing the fonts.
>>
>>
>>
>> When do you need the bitmap? For example, it might be needed on first
>>
>> call to some static method in the class, or the first time an instance
>>
>> of the class is created ...
>>
>>
>>
>> Patricia
>
> On first call to some static method in the class
>

In that case, put the initialization in a static initializer:

static {
   // create the bitmap
}

It will be run on the first event that causes initialization of the
class. Invocation of a static method is one of those events.

Patricia

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

startup code bob smith <bob@coolfone.comze.com> - 2012-08-28 11:48 -0700
  Re: startup code Roedy Green <see_website@mindprod.com.invalid> - 2012-08-28 11:53 -0700
    Re: startup code Lew <lewbloch@gmail.com> - 2012-08-28 14:00 -0700
      Re: startup code Robert Klemme <shortcutter@googlemail.com> - 2012-08-28 23:48 +0200
        Re: startup code Lew <lewbloch@gmail.com> - 2012-08-28 15:25 -0700
        Re: startup code Patricia Shanahan <pats@acm.org> - 2012-08-29 08:27 -0700
          Re: startup code bob smith <bob@coolfone.comze.com> - 2012-08-29 11:18 -0700
            Re: startup code Patricia Shanahan <pats@acm.org> - 2012-08-29 11:58 -0700
              Re: startup code Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-08-29 15:41 -0400
                Re: startup code Lew <lewbloch@gmail.com> - 2012-08-29 13:04 -0700
                Re: startup code Robert Klemme <shortcutter@googlemail.com> - 2012-08-29 22:06 +0200
                Re: startup code Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-08-29 17:14 -0400
      Re: startup code Roedy Green <see_website@mindprod.com.invalid> - 2012-08-29 00:21 -0700
        Re: startup code Patricia Shanahan <pats@acm.org> - 2012-08-29 02:42 -0700
          Re: startup code Patricia Shanahan <pats@acm.org> - 2012-08-29 02:54 -0700
    Re: startup code Arne Vajhøj <arne@vajhoej.dk> - 2012-08-28 19:20 -0400
  Re: startup code Jeff Higgins <jeff@invalid.invalid> - 2012-08-28 15:22 -0400
  Re: startup code Arne Vajhøj <arne@vajhoej.dk> - 2012-08-28 19:19 -0400

csiph-web