Search 5,000,000+ questions and answers.

Frequently Asked Questions

Sect. 17) What's the equivalent of sizeof()?

Java Programmer's FAQ - Part D
To check on the size of a primitive type. In Java, the sizes of primitive types are fixed in the language specification (a short is _always_ 16 bits; an int is _always_ 32 bits, etc), so this is no longer necessary. In memory allocation (i.e. malloc (32 * (sizeof(int));) In Java you always allocate a specific type of object, rather than a block of raw memory that you will fill as you like. The system always knows the size of the kind of objects you are allocating. So sizeof is not needed.
Related Questions

Sect. 17) Does Java have the equivalent of "const" arguments in C and C++?

Java Programmer's FAQ - Part D
Java 1.1 adds the ability to use the "final" keyword to make arguments constant. When used to qualify a reference type, however, this keyword indicates that the reference is constant, not that the object or array referred to is constant. For example, the following Java code: void foo(final MyClass c, final int a[]) { c.
Related Questions

Sect. 17) What is the equivalent of C++'s "friend"?

Java Programmer's FAQ - Part D
The keyword "friend" in C++ is a hack to allow a piece of code to access the private member declarations of another class. In the Java programming language, you would do this by labelling, not the friend, but the private members. Instead of making them private, make them either protected or package (no keyword) or public. package (specified by omitting other keywords) is the default level of protection; members are accessible from any class within the package of the containing class.
Related Questions

Sect. 17) Are there any hacks around this?

Java Programmer's FAQ - Part D
Certainly! There are always hacks around stuff. One way of enforcing constant values is to have two interfaces, a constant one and a non-constant one, e.g. public interface ConstFoo { int getValue(); } public interface Foo extends ConstFoo { int getValue(); void setValue(int i); }
Related Questions

NULLing out references that you've finished with. 11.3 What's the Java equivalent of sizeof()?

Java Programmer's FAQ
To check on the size of a primitive type. In Java, the sizes of primitive types are fixed in the language specification (a short is _always_ 16 bits; an int is _always_ 32 bits, etc), so this is no longer necessary. In memory allocation (i.e. malloc (32 * (sizeof(int));) In Java you always allocate a specific type of object, rather than a block of raw memory that you will fill as you like. The system always knows the size of the kind of objects you are allocating. So sizeof is not needed.
Related Questions

Sect. 17) How are finalizers different from C++ destructors?

Java Programmer's FAQ - Part D
Java programming language objects are not explicitly deleted and do not have destructors. Instead they are implicitly garbage collected when the JVM realizes your program can no longer access them. This technology is not based on reference counting and will cope with circular references. Every object has a routine called finalize() which will be called before the object is collected. This is the nearest equivalent to C++'s destructor.
Related Questions

Sect. 17) How can I write C/C++ style assertions?

Java Programmer's FAQ - Part D
The two classes shown below provide an assertion facility. Set Assert.enabled to true to enable the assertions, and to false to disable assertions in production code. The AssertionException is not meant to be caught--instead, let it print a trace. Since the exception is not meant to be caught, we just extend Error instead of RuntimeException. As with RuntimeException, a method does not need to declare that it throws Error. In addition programmers are less likely to write "catch(Error) ..
Related Questions

Sect. 17) What happens to post-increment when an exception is thrown?

Java Programmer's FAQ - Part D
If you have the code: array[i++] = foo(); and foo() throws an exception, i will be incremented anyway. This can cause problems if sometimes foo() throws an exception and you don't want i incremented in cases when it does. This is a consequence of JLS 15.25.1 and 15.6.1 "the left-hand operand of a binary operator appears to be fully evaluated before any part of the right-hand operand is evaluated." (assignment is taken as a binary operator). Note that this is not how C++ behaves.
Related Questions

Sect. 17) How do I translate C/C++ into Java programming langauge or vice-versa?

Java Programmer's FAQ - Part D
In general it is not simple to translate C/C++ into Java programming language, as Java lacks the arbitrary pointer arithmetic of those languages. If your C code does not use pointer arithmetic, automatic translation gets a lot simpler. Try these URLs: Going the other way there are currently three freely-available tools to translate Java programming language into C. It seems that these have been done for hacking value, rather than practical purposes.
Related Questions

Why doesn't sizeof properly report the size of an array which is a parameter to a function?

Infrequently Asked Questions in comp.lang.c
Part of the ANSI conspiracy to restrict people to passing pointers; this was undertaken after the first discovery that passing large arrays recursively could cause crashes. Since then, with the passing of MS-DOS, it has become a non-issue; since all serious machines have virtual memory, you can pass as much data as you want on the stack without detectable problems. [a]
Related Questions

FAQ Index What is a synonym or equivalent?

Diseases Database Content: Frequently Asked Questions Diseas...
Synonyms: any single item on the Diseases Database can have many 'names'. Thus you will find chronic obstructive pulmonary disease if you search for it as COAD, COPD or chronic obstructive airways disease. Equivalents: e.g. hyperbilirubinaemia and jaundice. One is a physical sign , the other a biochemical abnormality. The threshold for clinically observable jaundice is higher than the upper limit of normal for serum bilirubin.
Related Questions

Is there something equivalent to wish in Perl/Tk?

comp.lang.perl.tk FAQ
The idea of wish is that you read from <STDIN> and evaluate each statement. The standard way to do this in Perl/Tk is to use the tkpsh script that comes in your Perl/Tk build directory. Another elegant way to get wish like behavior in Perl/Tk is to use rmt which you can find in perl5/Tk/demos in your Perl/Tk distribution. When you run rmt you already have Tk.pm set up for you so you can start typing things like $mmm = new MainWindow; etc. at the rmt: prompt.
Related Questions

What is a generic equivalent?

Gundersen Lutheran Health Plan - Frequently Asked Questions
A medication that contains identical amounts of the same active drug ingredient in the same dosage form and route of administration that is expected to have the same clinical effects and safety profile as another product as designated by the US FDA.
Related Questions

Why is a same-sex union not equivalent to a marriage?

USCCB - (FLWY) - Marriage and Same-Sex Unions
A same-sex union contradicts the nature and purposes of marriage. It is not based on the natural complementarity of male and female. It cannot cooperate with God to create new life; and the natural purpose of sexual union cannot be achieved by a same-sex union. Because persons in a same-sex union cannot enter into a true conjugal union, it is wrong to equate their relationship to a marriage.
Related Questions

What is a "35mm equivalent" focal length?

Digital Photography FAQ
Every lens has a focal length which is a physical property of the lens. Once the lens is made, this cannot be changed. The field of view associated with a lens will be a function of the area projected by the lens that is captured by the camera. For 35mm film photography, this area is 36mm by 24mm. Note that if you change the area captured, the field of view also changes.
Related Questions

i. What is equivalent facilitation?

Section 508 Acquisition FAQ's
The Access Board’s standards provide that agencies may accept EIT offered by vendors which uses designs or technologies that do not meet the applicable technical provisions in Subpart B but provide substantially equivalent or greater access to and use of a product for people with disabilities. (See 36 CFR 1194.5.) This is referred to as "equivalent facilitation." Equivalent facilitation is not an exception or variance from the requirement to provide comparable access.
Related Questions

What if I took an equivalent prerequisite at another college?

Frequently Asked Questions
The easiest way to meet a prerequisite is to take the prerequisite at LBCC. For example, a student would normally take CHEM 1A at LBCC prior to enrolling in CHEM 1B. If the student took a course at another college which was equivalent to LBCC's CHEM 1A, it can be used to meet the prerequisite requirement for CHEM 1B.
Related Questions

What's the equivalent of Nothing?

FAQ for the microsoft.public.languages.csharp newsgroup
For reference types, the equivalent of VB's Nothing is C#'s null. For value types, it's the default value - 0, false, etc.
Related Questions

Question #17: How will this degree help me?

Frequently Asked Questions (FAQ)
Answer: The program is specifically structured to enhance the areas of clinical practice, administration, education, and research. Core and elective courses focus on the development of knowledge and skills that are most in demand by both PTs and their current or prospective employers. Finally, having a doctoral degree has been noted by some PTs to increase their marketability in the work force.
Related Questions

Question 17: How do I remit my MIP?

HUD FAQ - FHA
Answer: See Mortgage Letter 94-9 for instructions. You may also contact the ACH Outreach Team at (202) 537-8004.
Related Questions

Why does ps get signal 17?

procps - Frequently Asked Questions (FAQ)
No ps release has ever had this problem. Most likely your system has been broken into. You might want to install a more recent version of the OS. If you'd rather take your chances, simply upgrade procps.
Related Questions

Return to top 17. What is an Adversary Proceeding?

U.S. Bankruptcy Court - District of Colorado - FAQs
adversary proceeding is a lawsuit arising in or related to a particular bankruptcy case. It is commenced by filing a Complaint with the Court, and is given a separate case number. The Federal Rules of Bankruptcy Procedure and the Local Bankruptcy Rules state which actions must be brought as adversary proceedings, and the rules and procedures pertaining to adversary proceedings. Adversary proceedings are extremely complex, so you are strongly urged to consult with a bankruptcy attorney.
Related Questions

What should sizeof (struct xyzzy) return?

DJGPP Frequently-Asked Questions List
A : No, it's not a bug. GCC generates 32-bit code, and in that mode, there is a significant penalty (in terms of run-time performance) for unaligned accesses, like accessing a 16-bit short which isn't aligned on a word boundary, or accessing a 32-bit int which isn't aligned on a dword boundary. To produce faster code, GCC pads struct fields so that each field can be accessed without delays; this sometimes produces struct size which is larger than the sum of the sizes of its fields.
Related Questions

Is the SOL some kind of sect or a church?

Servants of the Light School of Occult Science, a fully cont...
Absolutely not. We are a school. We teach through correspondence, and the school is organised as a loose structure precisely in order to avoid any sectarianism and to encourage independence and free thinking. We do not interfere in our members' private lives or belief systems.
Related Questions

Why is there a distinction between assignment and algebraic rules? Aren't they equivalent?

SBML Frequently Asked Questions
Although it is typically easy to transform between assignment and algebraic rules, we make the distinction in SBML because: Algebraic rules define the point in the model where there is a circular dependency between variables. For instance, the equations and have a circular dependancy. It is not possible to form such a dependancy in scalar rules (see the SBML Level 2 specification). At least one of the example equations would have to be encoded as an algebraic rule in SBML.
Related Questions

What about its human equivalent vCJD?

Frequently asked questions about BSE
Variant Creutzfeldt-Jacob Disease (vCJD) was first diagnosed in 1996. It is now generally assumed to be caused by the transmission of BSE to humans. There are 99 confirmed or suspected cases in the EU to date, mostly in young people. All cases have occurred in the UK with the exception of France (3) and Ireland (1)). Estimates of the future number of vCJD cases vary widely as too little is known about the incubation period between exposure to the infective agent and the emergence of symptoms.
Related Questions

Is there an AASHE equivalent for K-12?

AASHE: Frequently Asked Questions
We are not aware of an exact AASHE equivalent for K-12. However, North American Association for Environmental Education and the Cloud Institute for Sustainability Education may be of interest. In addition, K-12 institutions are welcome to join AASHE.
Related Questions

Got A Question? Ask Our Community!


More Questions >>

© Copyright 2007-2008 QueryCAT
About • Webmasters • Contact