@nabbit123/

Project15B

Java

No description

fork
loading
Files
  • Main.java
  • Contact.class
  • Contact.java
  • Main.class
  • Sorts.class
  • Sorts.java

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.4017377386679384","path":"Main.java","file":{"path":"Main.java","content":{"asEncoding":{"base64":"cHVibGljIGNsYXNzIE1haW57Ci8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLy8gQ3JlYXRlcyBhbiBhcnJheSBvZiBDb250YWN0IG9iamVjdHMsIHNvcnRzIHRoZW0sIHRoZW4gcHJpbnRzCi8vIHRoZW0uCi8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpewogIENvbnRhY3RbXSBmcmllbmRzID0gbmV3IENvbnRhY3RbN107CiAgZnJpZW5kc1swXSA9IG5ldyBDb250YWN0ICgiR2lvdmFubmkiLCAiUm9qYXMiLCAiODU0LTc3Ny04NDI2Iik7CiAgZnJpZW5kc1sxXSA9IG5ldyBDb250YWN0ICgiTXVta2V5IiwgIkpvbmVzIiwgIjMxNy03NzctOTU0MiIpOwogIGZyaWVuZHNbMl0gPSBuZXcgQ29udGFjdCAoIlBldGVyIiwgIkdyaWZmZW4iLCAiMjE1LTc3Ny0xNTk2Iik7CiAgZnJpZW5kc1szXSA9IG5ldyBDb250YWN0ICgiU3RldmUiLCAibGFzdCIsICI2ODgtNzc3LTEyMzQiKTsKICBmcmllbmRzWzRdID0gbmV3IENvbnRhY3QgKCJCYW5qbyIsICJLYXppb29lIiwgIjQ2Ni03NzctODQ2MiIpOwogIGZyaWVuZHNbNV0gPSBuZXcgQ29udGFjdCAoIlBoZWxwcyIsICJGcmFuayIsICI1ODItNzc3LTY1NDgiKTsKICBmcmllbmRzWzZdID0gbmV3IENvbnRhY3QgKCJEZW1hcmkiLCAiQmxhY2siLCAiOTUzLTc3Ny03NTQyIik7CiAgU29ydHMuaW5zZXJ0aW9uU29ydChmcmllbmRzKTsKICBmb3IgKGludCBpbmRleCA9IDA7IGluZGV4IDwgZnJpZW5kcy5sZW5ndGg7IGluZGV4KyspCiAgU3lzdGVtLm91dC5wcmludGxuIChmcmllbmRzW2luZGV4XSk7CiAgfQp9Cg=="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
public class Main{
//-----------------------------------------------------------------
// Creates an array of Contact objects, sorts them, then prints
// them.
//-----------------------------------------------------------------
public static void main (String[] args){
  Contact[] friends = new Contact[7];
  friends[0] = new Contact ("Giovanni", "Rojas", "854-777-8426");
  friends[1] = new Contact ("Mumkey", "Jones", "317-777-9542");
  friends[2] = new Contact ("Peter", "Griffen", "215-777-1596");
  friends[3] = new Contact ("Steve", "last", "688-777-1234");
  friends[4] = new Contact ("Banjo", "Kaziooe", "466-777-8462");
  friends[5] = new Contact ("Phelps", "Frank", "582-777-6548");
  friends[6] = new Contact ("Demari", "Black", "953-777-7542");
  Sorts.insertionSort(friends);
  for (int index = 0; index < friends.length; index++)
  System.out.println (friends[index]);
  }
}