Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: DIFFERENCE

  1. #1
    Junior Member
    Join Date
    Jan 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation DIFFERENCE

    WHAT IS THE DIFFERENCE BETWEEN import java.awt.*; and import java.awt.event.*;


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: DIFFERENCE

    What do you think the difference is?

    One imports everything in the java.awt package. The other imports everything in the java.awt.event package.

    And just a note for the future: you might want to try using more informative titles (and proper capitalization) in your posts, otherwise people are more likely to simply ignore you.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Member andbin's Avatar
    Join Date
    Dec 2013
    Location
    Italy
    Posts
    443
    Thanks
    4
    Thanked 122 Times in 114 Posts

    Default Re: DIFFERENCE

    Quote Originally Posted by JIJESHJEANS View Post
    WHAT IS THE DIFFERENCE BETWEEN import java.awt.*; and import java.awt.event.*;
    They "import" classes from different packages. One package is java.awt and another is java.awt.event. They are different and unrelated.

    The "import on demand" (the one with '.*') can import only classes in one package .... not in subpackages. You can't say, for example, import java.*; thinking/hoping to import "everything".
    Andrea, www.andbin.netSCJP 5 (91%) – SCWCD 5 (94%)

    Useful links for Java beginnersMy new project Java Examples on Google Code

  4. #4
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: DIFFERENCE

    Good luck on the rest of your test/quiz.

Similar Threads

  1. Difference between ++i and i++
    By azya in forum Java Theory & Questions
    Replies: 4
    Last Post: November 29th, 2013, 09:09 AM
  2. [SOLVED] What is the difference?
    By 344a in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 19th, 2013, 09:26 AM
  3. Difference ++j and J++
    By rayan2004 in forum Loops & Control Statements
    Replies: 4
    Last Post: December 4th, 2012, 01:42 AM
  4. What is the difference?
    By soul_samir in forum Java Theory & Questions
    Replies: 1
    Last Post: February 11th, 2012, 03:08 PM
  5. Need to know this difference
    By arvind in forum Java Theory & Questions
    Replies: 2
    Last Post: January 19th, 2010, 06:24 AM