Results 1 to 4 of 4
  1. #1
    kris09 is offline Member
    Join Date
    Aug 2008
    Posts
    6
    Rep Power
    0

    Default import java.util ????

    i got a question i was writeing this program i was using import java.util.Scanner; what does it really do besides doing input for java. i also
    got this other one called import java.util.*;
    what does that do. sorry for all these questions just a beginner a java
    thanks for any help

    - kris

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,401
    Rep Power
    25

    Default

    The import statement provides an extension to the classpath to help the compiler find class definitions. It doesn't do any input, its only information to help the compiler find class files.

  3. #3
    kris09 is offline Member
    Join Date
    Aug 2008
    Posts
    6
    Rep Power
    0

    Default

    thanks norm :)

  4. #4
    Rooneyz is offline Member
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    25
    Rep Power
    0

    Default

    FYI, java.util.* imports all the classes in the java.util-package including java.util.Scanner. So if you have both statements in your code you can leave the java.util.Scanner out.

Similar Threads

  1. error with import java.io.*
    By osval in forum New To Java
    Replies: 5
    Last Post: 05-13-2010, 05:03 PM
  2. java.util
    By Java Tutorial in forum Java Tutorial
    Replies: 1
    Last Post: 02-07-2008, 01:46 PM
  3. how to import jface in java swt
    By rajaletchumy in forum New To Java
    Replies: 1
    Last Post: 08-08-2007, 12:31 AM
  4. java.util.DateFormat not found in import
    By christina in forum New To Java
    Replies: 2
    Last Post: 08-05-2007, 10:31 PM
  5. The import java.util.Scanner cannot be resolved
    By Heather in forum Advanced Java
    Replies: 1
    Last Post: 07-08-2007, 01:05 AM

Posting Permissions

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