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

📄 stringhashcode.java

📁 金旭亮的java教案
💻 JAVA
字号:
// StringHashCode.java
// This program demonstrates the method 
// hashCode of the String class.


import javax.swing.*;

public class StringHashCode {
   public static void main( String args[] )
   {
      String s1 = "hello",
             s2 = "Hello";


      String output =
         "The hash code for \"" + s1 + "\" is " +
         s1.hashCode() + 
         "\nThe hash code for \"" + s2 + "\" is " +
         s2.hashCode();

      JOptionPane.showMessageDialog( null, output,
         "Demonstrating String Method hashCode",
         JOptionPane.INFORMATION_MESSAGE );

      System.exit( 0 );
   }
}

⌨️ 快捷键说明

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