JAVA 入门程序 小写字母转换为大写字母 对话框实现

package 作业;
import javax.swing.JOptionPane;
public class 小写字母转换为大写字母对话框 {


public static void main(String[] args) {



String temp = JOptionPane.showInputDialog(null,"请输入任意小写字母","input",
JOptionPane.QUESTION_MESSAGE );
char b=temp.charAt(0);
char c=(char)(int)(b-32);
JOptionPane.showMessageDialog(null, "转换为大写字母"+c, "output", 
JOptionPane.INFORMATION_MESSAGE);

}


}
发布了33 篇原创文章 · 获赞 1 · 访问量 4175

猜你喜欢

转载自blog.csdn.net/qq_39827677/article/details/79932933
今日推荐