Hi Everyone, I am a beginner with java, please pardon my stupidity
The program below is not working and I have this error. Please let me know what I am doing wrong.
public class test {
public static void main(String[] args) throws Exception {
String Month = "May";
if ( Month == "May") {
String sign = "Gemini";
int DDay = 26;
}
if ( DDay == 26) {
String color = "Yellow";
}
System.out.printf("Jack Star Sign is:");
System.out.printf(sign);
System.out.printf(color);
}
}
test.java:30: cannot find symbol
symbol : variable sign
location: class test
System.out.printf(sign);
^
test.java:31: cannot find symbol
symbol : variable color
location: class test
System.out.printf(color);
^
2 errors
-----------------------------------------------------------------------------