Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML

Tutorial Categories: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML


 

Search Host

Monthly Fee($)
Disk Space (MB)
Register With us for Newsletter!
Visit Forum! Post Questions!
Jobs At RoseIndia.net!

Have tutorials?
Add your tutorial to our Java Resource and get tons of hits.

We offer free hosting for your tutorials. and exposure for thousands of readers. drop a mail
roseindia_net@yahoo.com
 
   

Tutorials

Java Server Pages

JAXB

Java Beans

JDBC

MySQL

Java Servlets

Struts

Bioinformatics

Java Code Examples

Interview Questions

 
Join For Newsletter

Powered by groups.yahoo.com
Visit Group! Post Questions!

Web Promotion

Web Submission

Submit Sites

Manual Submission?

Web Promotion Guide

Hosting Companies

Web Hosting Guide

Web Hosting

Linux

Beginner Guide to Linux Server

Frameworks

Persistence Framework

Web Frameworks

Free EAI Tools

Web Servers

Aspect Oriented Programming

Free Proxy Servers

Softwares

Adware & Spyware Remover

Open Source Softwares

JDK 1.4 the NullPointerException

       

2002-12-31 The Java Specialists' Newsletter [Issue 062b] - Follow-up and Happy New Year!

Author: Dr. Heinz M. Kabutz

If you are reading this, and have not subscribed, please consider doing it now by going to our subscribe page. You can subscribe either via email or RSS.


First of all, I wish you all the best for the year 2003!

Two of our readers, Dimitris Andreou from Greece and another by the name of Snow, pointed out that in JDK 1.4 the NullPointerException has been fixed. Have a look at Sun's website. Try compile the following class with the -target 1.4 option:

public class NestedBug3 {
  private Integer wings = new Integer(2);
  public NestedBug3() {
    new ComplexBug();
  }
  private class ComplexBug extends Insect {
    ComplexBug() {
      System.out.println("Inside ComplexBug Constructor");
    }
    public void printDetails() {
      System.out.println(wings);
    }
  }
  public static void main(String[] arguments) {
    new NestedBug3();
  }
}

When you compile this with -target 1.4 you will only be able to run it with a JVM 1.4 and later. Here is the output:


Inside Insect() Constructor
2
Inside ComplexBug Constructor

What happens in the inner class? Let's have a quick look:


jad -noinner NestedBug3$ComplexBug.class

class NestedBug3$ComplexBug extends Insect {
  NestedBug3$ComplexBug(NestedBug3 nestedbug3) {
    this$0 = nestedbug3;
    super();
    System.out.println("Inside ComplexBug Constructor");
  }
  public void printDetails() {
    System.out.println(NestedBug3.access$000(this$0));
  }
  private final NestedBug3 this$0; /* synthetic field */
}

You can seen that the assignment of this$0 and the call to super() have been swapped around.

In case you were wondering where to get hold of JAD, I wrote to the author and he told me to tell you to look at http://kpdus.tripod.com/jad.html. I want to hereby publicly thank Pavel Kuznetsov for making this great tool freely available. I have learnt more from this tool than from any other Java tool.

In case you were wondering why I am spending my New Year's Party writing a newsletter, I just want to get this done quickly so that I can put the follow-up into the 2002 folder ;-)

Heinz

This material from The Java(tm) Specialists' Newsletter by Maximum Solutions (South Africa). Please contact Maximum Solutions for more information.

       

Useful Links
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright 2007. All rights reserved.