Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Help > Re: static fiel...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 4 Topic 15976 of 16078
Post > Topic >>

Re: static field should be accessed in a static way

by Hendrik Maryns <gtw37bn02@[EMAIL PROTECTED] > Apr 16, 2008 at 11:34 AM

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig15207CBA3ADBFEB9406D828C
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

ireallyneedtoknow2007@[EMAIL PROTECTED]
 schreef:
> Hi
> I need to get the current time + 15 minutes for a given time zone.
>=20
> Question: the c.get(...) show warnings such as
> "The static field Calendar.HOUR_OF_DAY should be accessed in a static
> way"

It=E2=80=99s not c.get() which is the problem, but that which is inside o=
f it.=20
In the lines above, you do it right: c.get(Calendar.YEAR)

> 		Calendar.getInstance(TimeZone.getTimeZone(tz)).get(Calendar.YEAR),
Good.
> 	String t=3Df.format(c.get(c.YEAR)) +
Bad.

HTH, H.
--=20
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html


--------------enig15207CBA3ADBFEB9406D828C
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFIBcg4e+7xMGD3itQRApHAAJ9WBuEpu2gKsyeUSDmJiNihLtfPPACfaoHk
Rgx6o+98H79Tl2DSvMBJYPg=
=KWfK
-----END PGP SIGNATURE-----

--------------enig15207CBA3ADBFEB9406D828C--




 4 Posts in Topic:
static field should be accessed in a static way
ireallyneedtoknow2007@[EM  2008-04-15 18:00:32 
Re: static field should be accessed in a static way
Chase Preuninger <chas  2008-04-15 18:08:19 
Re: static field should be accessed in a static way
Roedy Green <see_websi  2008-04-16 03:18:09 
Re: static field should be accessed in a static way
Hendrik Maryns <gtw37b  2008-04-16 11:34:42 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 2:37:25 CDT 2008.