First off, indent your code: it makes it a whole load more readable, and the more readable it is, the more reliable it is in general - because it's harder to make "silly mistakes" and have them not be spotted.
For example, if you indented your code, you'd see the spurious double quotes in your code that effectively "comment out" chunks of your code:
int c="str.charAt(i);
if(Character.isUpperCase(c))
{
c=c+(key%26);
if(c">'Z')
c=c-26;
}
Second, how do you know that "Encryption is working and decryption is not working"? How have you tested it? OR did you assume that because the encryption generates hard-to-read output it must be correct?
Third, that's not encryption: that's translation; a variant of the Caesar Cypher that can be "cracked" in minutes by almost anyone. Heck they publish whole magazines every month so little old ladies can do it for fun ...
So start with a small known string: "ABCDEF" and manually translate that. Then manually decrypt it. Try it with a variety of "key" values. When that produces the same string as the original, then run the same string through your "encryption" method. Compare the results. Are the absolutely identical? If so, encryption is possibly OK. If not, why not? How are they different?
When that is right, run your manually encrypted string through your "decryption" method. Do you get the original back? If so, try using both methods together. If you don't, why not?
If all that works, run the string through encryption, then pas the result to decryption, and compare the output to the original input. If they are the same, try again with longer, more complex strings. If not, why not?
Whenever you reach a "why not?" reach for the debugger and start using it to look at exactly what your code is doing while it is running. Time for you to learn a new (and very, very useful) skill: debugging!