SHARE
TWEET

Untitled

a guest Jun 24th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package _1_week1OneDimensionalArrayJune17June21;
  2.  
  3. import javax.swing.*;
  4. public class _6_ArrayClass6ExerciseRunner {
  5.  
  6.     public static void main(String[] args) {
  7.         // TODO Auto-generated method stub
  8.  
  9.         double arraysize;
  10.         arraysize = Double.parseDouble(JOptionPane.showInputDialog ("Enter Array Size: "));
  11.        
  12.         _5_ArrayClass5Exercise array1 = new _5_ArrayClass5Exercise(arraysize);
  13.        
  14.         _5_ArrayClass5Exercise [] array2 = new _5_ArrayClass5Exercise[(int) array1.getArraySize()];
  15.        
  16.         for (int ctr = 0; ctr < array2.length; ctr++) {
  17.             array2[ctr]= new _5_ArrayClass5Exercise(Integer.parseInt(JOptionPane.showInputDialog("Enter keys: ")), JOptionPane.showInputDialog ("Enter message: "));
  18.         }
  19.         for (int ctr = 0; ctr < array2.length; ctr++) {
  20.             JOptionPane.showMessageDialog(null, array2[ctr].getKeys() +" "+ array2[ctr].getMessage());
  21.         }
  22.     }
  23.  
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top