Need Help

So when you run this in Eclipse Juno, it first shows what you want to change to. So i type in Hours and then for second one Seconds. After that the program stops. Im guessing its an if problem. I dont know? Here is Program:

import java.util.Scanner;

public class TimeConverter {

/**

  • @param args
    */
    static Scanner input = new Scanner(System.in);
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    int hours;
    int minutes;
    int seconds;
    System.out.println("Enter what you want you are converting");
    String Response1 = input.nextLine();

System.out.println("Enter what you want you want to convert to");
String Response2 = input.nextLine();

if(Response1 == "Hours" && Response2 == "Minutes"){
System.out.println("Enter Number of hours");
hours = input.nextInt();

System.out.println((hours*60) + " hours");
}

if(Response1 == "Hours" && Response2 == "Seconds"){
System.out.println("Enter Number of hours");
hours = input.nextInt();

System.out.println((hours*3600) + " seconds");
}

if(Response1 == "Minutes" && Response2 == "Hours"){
System.out.println("Enter Number of minutes");
minutes = input.nextInt();

System.out.println((minutes/60) + " hours");
}

if(Response1 == "Seconds" && Response2 == "Hours"){
System.out.println("Enter Number of seconds");
seconds = input.nextInt();

System.out.println((seconds/3600) + " hours");
}

if(Response1 == "Minutes" && Response2 == "Seconds"){
System.out.println("Enter Number of Minutes");
minutes = input.nextInt();

System.out.println((minutes*60) + " seconds");
}

if(Response1 == "Seconds" && Response2 == "Minutes"){
System.out.println("Enter Number of seconds");
seconds = input.nextInt();

System.out.println((seconds/60) + " minutes");
}

}

}

Welcome to the Arduino Programming Forum (not the Java forum). Please read the two posts at the top of this Forum by Nick Gammon on guidelines for posting here, especially the use of code tags which make the code looklike thiswhen posting source code files. Also, before posting the code, use Ctrl-T in the IDE to reformat the code in a standard format, which makes it easier for us to read.

If you have already posted without using code tags, open your message and select "modify" from the pull down menu labelled, "More", at the lower left corner of the message. Highlight your code by selecting it (it turns blue), and then click on the "</>" icon at the upper left hand corner. Click on the "Save" button.

Do you understand what problem is?

Abogal:
Do you understand what problem is?

This is not a Java forum.

I will repeat: This is not a Java forum.

However: In Java, == compares identity. .eq(...) compares value. Your if statements should use .eq(...) and not ==.

If you have any further problems, please try elsewhere... unless the problems involve an Arduino.