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
-----------------------------------------------------------------------------

jumped the gun. For the benefit of the people who are like me

public class test1 { 
    public static void main(String[] args) throws Exception { 
         String Month = "May"; 
         String sign=""; 
         String color=""; 
         int DDay = 26; 
         if ( Month == "May")  { 
                 sign = "Gemini"; 
                 //int DDay = 26; 
         } 
         if ( DDay == 26) { 
                 color = "Yellow"; 
         } 
         System.out.printf("Jack Star Sign is:"); 
         System.out.printf(sign); 
         System.out.printf(color); 
         } 
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.