import javax.swing.*;
class H8Ex4 { 
public static void main(String args[] ) 
{ double A[][]={{1.0,2.0},{3.0,4.0}}; 
double B[][]={{1.0,1.0},{1.0,1.0}}; 
matrix M1=new matrix(A); 
String s="First Matrix = \n"+M1.toString(); 
matrix M2=new matrix(B); 
s+="Second Matrix = \n"+M1.toString(); 
M1.add(M2);  
s+="addition of two matrices : \n"+M1.toString(); 
String s1="Array example: class matrix";
JOptionPane.showMessageDialog(null,s,s1,JOptionPane.PLAIN_MESSAGE); 
} }