Click here to Skip to main content
15,889,863 members
Home / Discussions / Java
   

Java

 
AnswerRe: J2ME Pin
427748024-Sep-09 18:50
427748024-Sep-09 18:50 
Questionplz help in java question Pin
arifihsan24-Sep-09 0:35
arifihsan24-Sep-09 0:35 
AnswerRe: plz help in java question Pin
Richard MacCutchan24-Sep-09 1:21
mveRichard MacCutchan24-Sep-09 1:21 
AnswerRe: plz help in java question Pin
427748024-Sep-09 3:37
427748024-Sep-09 3:37 
QuestionLUCKY DRAW system Pin
syarizan23-Sep-09 23:03
syarizan23-Sep-09 23:03 
AnswerRe: LUCKY DRAW system Pin
Richard MacCutchan24-Sep-09 1:22
mveRichard MacCutchan24-Sep-09 1:22 
AnswerRe: LUCKY DRAW system Pin
427748024-Sep-09 2:58
427748024-Sep-09 2:58 
QuestionProblems Implementing Functions into Main.java Pin
wkid8722-Sep-09 17:42
wkid8722-Sep-09 17:42 
I'm having problems implementing all of my functions in the LinearFunction.java to my Main.java program file. I was able to implement getValue but not any of the rest of my function. What am I doing wrong?

<code>package Function;
/**
 * This interface defines a function
 * @author
 */

public interface Function {
/**
 * The smallest difference between two values
 * which is used to check and see if the difference
 * equals zero
 */
    public static double EPSILON = 0.000000001;  // nano
/**
 * Returns the range value for this function given
 * the domain value <code>inValue</code>
 * @param inValue
 * @return
 */
    public double getValue( double inValue );

}


package Function;<br />
/**<br />
 * This interface defines a function<br />
 * @ <br />
 */<br />
<br />
public interface Function {<br />
/**<br />
 * The smallest difference between two values<br />
 * which is used to check and see if the difference<br />
 * equals zero<br />
 */<br />
    public static double EPSILON = 0.000000001;  // nano<br />
/**<br />
 * Returns the range value for this function given<br />
 * the domain value <code>inValue</code><br />
 * @param inValue<br />
 * @return<br />
 */<br />
    public double getValue( double inValue );<br />
<br />
}

<code>/*
 *
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package Function;

/**
 *
 * @author 
 */
public class Main {
    
    /** Creates a new instance of Main */
    public Main() {
    }
    
    /**
     *
     * @param args
     */
    public static void main(String[] args) {
        //three constrctors are called through f, g, andh//
      Function f = new LinearFunction();
      Function g = new LinearFunction(2);
      Function h = new LinearFunction(3, 6);
      
     f.getYIntercept(1.0); 
             
      System.out.println("Y intercept="+f.getSlope());

      System.out.println("Slope="+f.setSlope());

        f.setSlope(2.0);

        

        

      for (int i = 0 ; i<10; i++ ){
          
        System.out.print("f(" +i+ ")="+f.getValue(i)+ "    ");
        System.out.print("g(" +i+ ")="+g.getValue(i)+ "    ");
        System.out.println("h(" +i+ ")="+h.getValue(i)+ "    ");
        
     
      }
      
    
      System.out.println();
    
}
}

AnswerRe: Problems Implementing Functions into Main.java Pin
David Skelly22-Sep-09 22:21
David Skelly22-Sep-09 22:21 
AnswerRe: Problems Implementing Functions into Main.java Pin
Richard MacCutchan22-Sep-09 23:05
mveRichard MacCutchan22-Sep-09 23:05 
GeneralRe: Problems Implementing Functions into Main.java Pin
wkid8723-Sep-09 3:50
wkid8723-Sep-09 3:50 
GeneralRe: Problems Implementing Functions into Main.java Pin
Richard MacCutchan23-Sep-09 5:43
mveRichard MacCutchan23-Sep-09 5:43 
GeneralRe: Problems Implementing Functions into Main.java Pin
David Skelly23-Sep-09 6:24
David Skelly23-Sep-09 6:24 
GeneralRe: Problems Implementing Functions into Main.java [modified] Pin
wkid8723-Sep-09 16:59
wkid8723-Sep-09 16:59 
GeneralRe: Problems Implementing Functions into Main.java Pin
David Skelly24-Sep-09 3:35
David Skelly24-Sep-09 3:35 
AnswerRe: Problems Implementing Functions into Main.java Pin
427748023-Sep-09 18:22
427748023-Sep-09 18:22 
QuestionN Queens Problem help Pin
shiggedyshwa21-Sep-09 19:20
shiggedyshwa21-Sep-09 19:20 
AnswerRe: N Queens Problem help Pin
427748021-Sep-09 20:27
427748021-Sep-09 20:27 
GeneralRe: N Queens Problem help Pin
shiggedyshwa21-Sep-09 21:15
shiggedyshwa21-Sep-09 21:15 
QuestionRead a file and find text Pin
Mbu00720-Sep-09 22:28
Mbu00720-Sep-09 22:28 
AnswerRe: Read a file and find text Pin
427748021-Sep-09 4:31
427748021-Sep-09 4:31 
QuestionHow do i get all values from a JTextfields that is located on another JInternalFrame? Pin
miceisland20-Sep-09 20:36
miceisland20-Sep-09 20:36 
AnswerRe: How do i get all values from a JTextfields that is located on another JInternalFrame? Pin
427748021-Sep-09 4:37
427748021-Sep-09 4:37 
QuestionHaving trouble with recursion (kind of long, but please read) Pin
KingLane20-Sep-09 12:48
KingLane20-Sep-09 12:48 
AnswerI got the code to work Pin
KingLane20-Sep-09 14:06
KingLane20-Sep-09 14:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.