View Single Post
  #1 (permalink)  
Old 12-07-2007, 01:09 PM
ravian ravian is offline
Senior Member
 
Join Date: Nov 2007
Posts: 115
ravian is on a distinguished road
NullPointerException
I get NullPointerException when I compile the following code. Can you tell me the problem in this one.

Code:
public class DrawRec { public static void main(String[] args) { Rectangle myRect; myRect.width = 40; myRect.height = 50; System.out.println("myRect's area is " + myRect.area()); } }
Reply With Quote
Sponsored Links