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!

pow(double,double) in java.lang.Math cannot be applied to (double,java.lan

807598Jun 23 2006 — edited Jul 7 2006
I just started an intro to java class recently and keep having an error while compiling that i cannot solve.

import java.util.*;
import java.text.*;
import javax.swing.*;

class HWFibon{

public static void main (String [] args){

int fibon ;
String n ;
fibon= Integer.parseInt(n);

n = JOptionPane.showInputDialog(null, "Enter Month No.:");

fibon = (int)( 1 / (Math.sqrt(5))) * ( (Math.pow(((1 + (Math.sqrt(5))) / 2)
, n)) - (Math.pow(((1 - (Math.sqrt(5))) / 2)
, n)));

JOptionPane.showMessageDialog(null, "Number of babies for Month No. "
n " " + fibon);
}
}

here is my main error and i believe it is coming from int fibon ;String n ;
ibon= Integer.parseInt(n);

pow(double,double) in java.lang.Math cannot be applied to (double,java.lang.String)

Message was edited by:
KWM04
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 4 2006
Added on Jun 23 2006
4 comments
1,940 views