⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 swap.txt

📁 java的一经典教程
💻 TXT
字号:
// Swaps the values of two variables
import javax.swing.JOptionPane;

public class Swap
{
	public static void main(String[] args)
	{
		// declare and initialise variables
		int first = 3;
		int second = 4;

      // Write out initial values
		JOptionPane.showMessageDialog(null,
		   "First variable: " + first
		   + "\nsecond variable: " + second);

      // swap values
		int temp;
		// temporary variable to facilitate the swap

		temp = first;
      first = second;
      second = temp;

      // Write out new values
		JOptionPane.showMessageDialog(null,
		   "First variable: " + first
		   + "\nsecond variable: " + second);

      System.exit(0);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -