Easy to Learn Java: Programming Articles, Examples and Tips

Start with Java in a few days with Java Lessons or Lectures


Code Examples

Java Tools

More Java Tools!

Java Forum

All Java Tips


Submit News
Search the site here...
Search the JavaFAQ.nu
1000 Java Tips ebook

1000 Java Tips - Click here for the high resolution copy!1000 Java Tips - Click here for the high resolution copy!

Java Screensaver, take it here

Free "1000 Java Tips" eBook is here! It is huge collection of big and small Java programming articles and tips. Please take your copy here.

Take your copy of free "Java Technology Screensaver"!.

Java Newsletters Archive: 161

JavaFAQ Home » Java Newsletters Go to all tips in Java Newsletters

Bookmark and Share

=== [ 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:
  • 1. Why Java Hot Spot Compiler has the name - Hot Spot?
  • 2. Why do I see the attribute in a derivative class? I can not access it anyway!
  • 3. How can I create a new Instance of InetAddress class? I have not found any constructor...
  • 4. Latest posts on our message board
  • 5. Link to Java FAQ

  • Hello dear friends!

    Tip 1

    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. "


    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.

    Tip 2

    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.

    Tip 3

    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

    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

    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
    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


    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


    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:

    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:

    If you have troubles please contact us: subscription@javafaq.nu

    Link to Java FAQ

    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


    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  Printer Friendly Page
     Send to a Friend  Send to a Friend

    .. Bookmark and Share

    Search here again if you need more info!
    Custom Search

    Home Code Examples Java Forum All Java Tips Books Submit News, Code... Search... Offshore Software Tech Doodling

    RSS feed Java FAQ RSS feed Java FAQ News     

        RSS feed Java Forums RSS feed Java Forums

    All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest 1999-2006 by Java FAQs Daily Tips.

    Interactive software released under GNU GPL, Code Credits, Privacy Policy