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

📄 matriks2.java

📁 it is file document,java file document,which is inform how to make matriks in java. Hope this will h
💻 JAVA
字号:
// matriks2.java
// matriks
import javax.swing.*;

  public class matriks2
  {
	  public static String output;
	  
  public static void main (String args[])
  {

      int A[][] = {{1,2}, {3,4}}  ;  //declare reference to an array
      int B[][] = {{5,6}, {7,8}}  ;  //declare reference to an array
   
   JTextArea outputArea = new JTextArea() ;
     
   output =  "Elemen Matriks A:";
   genOutput(A);
     
   output += "Elemen Matriks B:";
   genOutput(B);	     
   outputArea.setText( output );
   
   JOptionPane.showMessageDialog( null, outputArea,
	   "Initialisasi Matriks A dan B",
	   JOptionPane.INFORMATION_MESSAGE );
   
   System.exit(0);
   
  }//end main
   
  public static void genOutput(int array[][])
  {
int i;
int j;
      
  for (i=0;i<2;i++)
         {	     
	     output += "\n";
             for (j=0;j<2;j++)
                output += array[i][j] + "\t";
     }
   
  
       for (i=0;i<2;i++)
       {
	       output += "\n";
	       for (j=0;j<2;j++)
		       output += array[i][j] ;
       }
   
  }
          
        
	   
	   
	  }
	 
     
  
     //end class
/**********/
 


⌨️ 快捷键说明

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