Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
General <strong>Java</strong> Questions I<br />
public interface MyConstants{ // Note naming conventions<br />
int ID_OK=1; // public static final is implicit in interfaces<br />
// etc<br />
}<br />
Then anyone who wishes to use the constants without putting MyConstants before<br />
each reference can simply implement the interface.<br />
-by<br />
Gerhard Haring, Jon Skeet<br />
this advice first was published on comp.lang.java.programmer<br />
Q: Does anyone know what the character limit for a class name would be?<br />
I have my class name in a variable ft and I am doing a Class.forName(ft);<br />
My class name with qualifiers is 44 characters long, I can only imagine that there<br />
must be a limit ....<br />
Answer: From the JVM Spec 2 - 4.2<br />
--------------------------------------<br />
Class and interface names...fully qualified name...as<br />
CONSTANT_Utf8_info.<br />
--------------------------------------<br />
That structure, CONSTANT_Utf8_info, places a limit of 64k on the length. But for a<br />
class this is the fully qualified name, so the maximum length of the name could be<br />
less.<br />
-jschell<br />
Pick your topics, and we'll send you great deals, free<br />
information, and special offers by email from Focalex.<br />
IT Professional General Computer Design and Graphics Linux Freeware/Shareware<br />
Games Intranet Computer Hardware Web Design Computer Software<br />
UNIX Web Software Windows Software Personal Finance Programming Software<br />
<strong>Server</strong>s C/C++ Powerbuilder Perl XML<br />
<strong>Java</strong> SQL Design/Graphics Utilities Handhelds<br />
Get FREE STUFF, special offers and information on the <strong>Java</strong>, C/C++,<br />
SQL, XML and another languages programming topics YOU want to hear<br />
about delivered to your inbox!<br />
Unix, Windows Software/HardWare, Handhelds - just pick YOUR<br />
interests and start getting the stuff you want today. The best<br />
free info and deals on computers, software and much more by email.<br />
SUBSCRIBE for FREE HERE<br />
(c)1999, 2000, 2001 <strong>Java</strong>FAQ.nu. All rights reserved worldwide.<br />
This document is free for distribution, you can send it to everybody who is interested in <strong>Java</strong>.<br />
This document can not be changed, either in whole or in part<br />
without the express written permission of the publisher.<br />
All questions please mailto:info@javafaq.nu<br />
file:///F|/350_t/350_tips/general_java-I.htm (31 of 31) [2002-02-27 21:18:18]