Results 1 to 4 of 4

Thread: "unchecked or unsafe operations" compile error

Threaded View

  1. #1

    Thread Starter
    Fanatic Member TheVader's Avatar
    Join Date
    Oct 2002
    Location
    Rotterdam, the Netherlands
    Posts
    871

    Resolved "unchecked or unsafe operations" compile error

    This error is driving me nuts. I've just got back to using Java again, after half a year or so, and now I can't seem to compile this very simple project.

    I cannot add items (strings) to an ArrayList. I get the compile error ''Staafdiagram.java uses unchecked or unsafe operations.".

    Can anyone help me with this?
    Code:
    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    import java.util.*;
    
    public class Staafdiagram extends Applet {
    
    	public void paint(Graphics g) {
    		ArrayList uni;
    	        uni = new ArrayList();
            	uni.add("abc");
    	}
    }
    Last edited by TheVader; Nov 22nd, 2004 at 07:24 PM.
    Author for Visual Basic Web Magazine

    My articles on the Web Browser Control:
    Using the Web Browser Control & Using the DHTML Document Object Model

    The examples referenced in the articles can be found here:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width