whats a helper class?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: whats a helper class?

  1. #1
    Join Date
    Mar 2004
    Posts
    7

    whats a helper class?

    ive gotta write a program which has a JLabel and JText etc. fileds which is easy i can do that. the program is a 2 digit multiplication game,
    i.e.

    1 * 2 = 2 [JTextField]

    [JLabel] Correct or incorrect

    ok next



    where 1 and 2 are numbers generated by the helper class but what is it and where do i get it? this helper class generates two numbers and the user entyers the answer and it says correct or not. if its correct then the user clicks next and a new problem is generated by the helper class but how do i get it?

  2. #2
    Join Date
    Dec 2002
    Posts
    83
    I take it this is an assignment? By "helper class" the instructor probably just means a seperate Class you write that takes care of the creation of random integers. So in order to get the integers into your JTextField, they first have to be created by this other Class you write for that purpose.
    -- Steven

  3. #3
    Join Date
    Mar 2004
    Posts
    7
    so how do u vreate a class that generates 2 random numbers between 1 and 10?

  4. #4
    Join Date
    Dec 2002
    Posts
    83
    The easiest way is probably java.lang.Math.random(). I'll let you figure out the details.

    http://java.sun.com/j2se/1.4.2/docs/api/
    -- Steven

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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center