|
JavaFAQ Home » Java Newsletters

===
[ The Java FAQ Daily Tips, weekly publication ]
===
| Issue
No: 161
29 April 2003 |
| 12624 subscriber
|
Foreword: Excuse me for
possible mistakes. English is not native language for me.
In this issue:
Hello dear friends!
Question: Why Java Hot Spot Compiler has the name - Hot
Spot?
Answer: The best answer I actually found in "Technical
White Paper for the Java HotSpot Virtual Machine, v1.4.1" at SUN web
site: "Most attempts to accelerate Java programming language performance have
focused on applying compilation techniques developed for traditional languages.
Just-in-time (JIT) compilers are essentially fast traditional compilers that
translate the Java technology bytecodes into native machine code on the fly. A
JIT running on the end user's machine actually executes the bytecodes and
compiles each method the first time it is executed.
Adaptive optimization solves
the problems of JIT compilation by taking advantage of an interesting program
property. Virtually all programs spend the vast majority of their time executing
a minority of their code. Rather than compiling method by method, just in time,
the Java HotSpot VM immediately runs the program using an interpreter, and
analyzes the code as it runs to detect the critical hot spots in the program.
Then it focuses the attention of a global native-code optimizer on the hot
spots. By avoiding compilation of infrequently executed code (most of the
program), the Java HotSpot compiler can devote more attention to the
performance-critical parts of the program, without necessarily increasing the
overall compilation time. This hot spot monitoring is continued dynamically as
the program runs, so that it literally adapts its performance on the fly to the
user's needs.
A subtle but important
benefit of this approach is that by delaying compilation until after the code
has already been executed for a while (measured in machine time, not user time),
information can be gathered on the way the code is used, and then utilized to
perform more intelligent optimization. As well, the memory footprint is
decreased. In addition to collecting information on hot spots in the program,
other types of information are gathered, such as data on caller-callee
relationships for virtual method invocations. "
-- John
Java wimps please close your ears ... For
the Java programmer who thought he knew everything there was to know about
Java, have a look at the most advanced Java newsletter archived on the
website http://www.smotricz.com/kabutz Guess
what, it won't even cost you anything! Subscribe today - you won't be
disappointed.
Question: Why do I see the attribute in a derivative
class? I can not access it anyway!
Answer: You can access protected attributes in an
extended class or within of package where this class is.
Question: How can I create a new Instance of
InetAddress class? I have not found any constructor...
Answer: Like this: try { java.net.InetAddress
addr = java.net.InetAddress.getByName("javafaq.nu");
System.out.println(addr);
} catch (Exception exc)
{ // do smth here!!! }
Latest posts on our
message board |
| help!
I have a password box that will
be linked to a database. Once the users enter their password they will have
another panel where they can register their hobbies. It is not for the net but
simply on JBuilder for the moment. I had no problem setting up the GUI for both
the password and the other panel (the database link will be for later!) but as
I'm a very novice programmer I don't know how to link the two so that on a
user's screen there is a smooth transition between the password and the hobby
panel. The password class looks like this: more read
here | | |
| reverse string
hi, im new to java, and i have
an assignment which wants me to create a class that containsmethds to parse and
manipulate a string. the class should be called StringReverser. Its given me
an example which i dont really understand:
public String
ReverseString(String inputString)
How do i do it? more read
here | | |
| Reading hex chars from assembly code
Hi... I'm writing a Java
GUI, to interpret assembly code (based on Intel x86) and store this data for
output when querying with the GUI. Basically, when writing, I forgot to take
into account the fact that numbers in assembly are in hex (yup, pretty big
mistake!), and now I'm trying to implement the functionality to read and use
these hex characters for memory addresses and simple hex input... for
example: mov ax, [000A] mov [000B], 01C etc... So, my problem
is, I want to be able to recognise these strings as input and convert them
somehow, so I can perform operations on them, such as multiplication and
addition. Another problem that also comes from this is, I have created an
array of memory addresses, but obviously in Java, these arrays run in numerical
value and I need a way of recognizing hexadecimal memory addresses. more read
here | | |
| Interface with VB/COM+
I am looking for an API that
will allow me to interface JAVA with an existing application written in VB/COM+
Thanks.
more read
here | | |
| Help with simple program!!!!
--------------------------------------------------------------------------------
Hi, not sure if this forum is intended for help on course work so apologies
if not. I just really want someone to check over the program I have written and
let me know if there are any glaring errors I must: 1. Create a class
for each type of account 2. Create constructors for eash class, using
inheritance where possible 3. Create methods for depositing and withdrawing
funds as wel as for diplaying the current balance 4. Create additional
methods to check that the account balance against the agreed overdraft limit.
I think it almost fulfills all criteria now and i need to get 65% to
pass. I would be very grateful for any further constructive criticism before I
submit it. more read
here | | |
| calculate line
Hi
I have a line with
coordinated (x1 y1) (x2 y2). How can I make this line 2 times longer? more read
here | | |
| JPopupMenu removing borders / insets
Hi,
I have a popup menu
but, though I remove the borders, there is still space at the top and bottom of
the JPopupMenu. There is also a white line at the left side and a grey line (or
component?) on the right of the JPopupMenu. How can I remove this space / lines
from a JPopupMenu? Is this something that can be done through methods of the
Swing components or is it necessary to use L&F API to remove these insets
and borders? more read
here | | |
| Help - Heap file implementation
Can someone help me with the
heap file implementation of database? Where can I find some example coding for
that? or is there anyone who has experience of that? Thanks more read
here | | |
Please ask your questions and help each
other at our Java Forum: http://javafaq.nu/forum/
The Java FAQ Daily Tips is a newsletter
that is only sent to those who have specifically subscribed
to it (double opt-in).
To subscribe/unsubscribe to "The Java FAQ
Daily Tips" weekly edition newsletter visit our page
here: http://www.javafaq.nu/plm2html/my_subscription.shtml
If you have troubles please contact us: subscription@javafaq.nu
If you have added a link to http://javafaq.nu on your WEB-site, please let us
know and you will get listed on our "pages linking to us" pages! If your
page is a programming is programming relates you will of
course get listed in the WEB-directory as well. Also, if you link to us, you
have a chance to be listed in this
newsletter as well.
More information and graphics artworks can
be found here http://javafaq.nu/other/linktous.shtml
For information on advertising on the Java
FAQ's Daily Tips Newsletter, send an email to: adv@javafaq.nu You will get the answer
immediately from auto responder!
Send your comments, questions, praise and
complaints to us: comments@javafaq.nu
Copyright (c) 2000 -
2003 John Andersson, All rights reserved.
Printer Friendly Page
Send to a Friend
..
Search here again if you need more info!
|