DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3

Thread: Help is needed

  1. #1
    Join Date
    May 2005
    Location
    Ontario, Canada
    Posts
    173

    Help is needed

    Hi all,
    I am facing trouble running this program:


    import java.util.*;

    public class E07_RandomInts {

    static Random r = new Random();
    public static void compareRand() {
    int a = r.nextInt();
    int b = r.nextInt();
    System.out.println("a = " + a + ", b = " + b);
    if(a < b)
    System.out.println("a < b");
    else if(a > b)
    System.out.println("a > b");
    else
    System.out.println("a = b");
    }
    public static void main(String[] args) {
    for(int i = 0; i < 25; i++)
    compareRand();
    }
    } ///:~

  2. #2
    Join Date
    Mar 2004
    Posts
    635
    what do you need help with? whats the problem? be more specific

  3. #3
    Join Date
    May 2005
    Location
    Ontario, Canada
    Posts
    173
    I was able to run javac without any error, but not java after that.
    Now, it is solved. I did not have the right Path for the java.util.*
    I thank you for your respond.
    Have a nice one.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links