Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Help:Arrays and JOptionPane

807601Jan 25 2008 — edited Jan 25 2008
Factoring of integers. Write a ptogram that asks the user for an integer and the prints out all its factor. For example when the user enters 15 the program should print 1,3,5,15.
The confusion come when asked to use a class FactorGenerator with methods
- int nextFactor()
-boolean hasMoreFactors()

I have done myy best and the dialog box is just saying "ok" Help

import javax.swing.JOptionPane;

public class FactorGenerator
{
public static void main(String[] args)
{
int num;


for (int i = 1 ; i <= 15/2 ; i++)
if(15% i == 0)
{
int[] factors = new int[15];
}

JOptionPane.showMessageDialog(null,"");
}





}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 22 2008
Added on Jan 25 2008
1 comment
96 views