Actually fix the freaking arrays
This commit is contained in:
parent
8733d7099c
commit
d0ae2478a1
1
.gitignore
vendored
1
.gitignore
vendored
@ -96,3 +96,4 @@
|
||||
/Semester 1/Test Project/target/
|
||||
/Semester 2/Assignments/lab-2D-arrays_CalebFontenot/target/
|
||||
/Semester 2/Assignments/lab-2D-arrays-sort_CalebFontenot/target/
|
||||
/Semester 2/Assignments/lab3_CalebFontenot/target/
|
||||
|
@ -5,20 +5,21 @@
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace; font-weight: bold}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace; font-weight: bold}
|
||||
body {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
pre {color: #a9b7c6; background-color: #2b2b2b; font-family: monospace}
|
||||
table {color: #888888; background-color: #313335; font-family: monospace}
|
||||
.literal {color: #cc7832}
|
||||
.ST3 {font-family: monospace; font-weight: bold; font-style: italic}
|
||||
.ST4 {font-family: monospace; font-style: italic}
|
||||
.ST0 {color: #287bde}
|
||||
.ST3 {color: #9876aa}
|
||||
.number {color: #6897bb}
|
||||
.string {color: #6a8759}
|
||||
.ST2 {color: #9876aa}
|
||||
.ST5 {color: #8a653b}
|
||||
.comment {color: #808080}
|
||||
.whitespace {color: #505050}
|
||||
.ST1 {color: #ffc66d; font-family: monospace; font-weight: bold; font-style: italic}
|
||||
.ST4 {color: #9876aa; font-family: monospace; font-weight: bold; font-style: italic}
|
||||
.ST2 {color: #ffc66d; font-family: monospace; font-style: italic}
|
||||
.ST5 {color: #9876aa; font-family: monospace; font-style: italic}
|
||||
.ST1 {color: #808080; font-family: monospace; font-weight: bold}
|
||||
.ST6 {color: #8a653b}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
@ -32,63 +33,92 @@ table {color: #888888; background-color: #313335; font-family: monospace; font-w
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="comment">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment"> * </span><span class="ST1">@author</span> <span class="comment">caleb</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">class</span> Lab2DArraysSort_CalebFontenot {
|
||||
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">int</span> <span class="ST1">maxNumberOfColumnsInJagged2dArray</span>(<span class="literal">char</span>[][] ar) {
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">int</span> <span class="ST2">maxNumberOfColumnsInJagged2dArray</span>(<span class="literal">char</span>[][] ar)
|
||||
{
|
||||
<span class="literal">int</span> maxNumberOfColumns = <span class="number">0</span>;
|
||||
<span class="literal">for</span> (<span class="literal">int</span> row = <span class="number">0</span>; row < ar.<span class="ST2">length</span>; ++row) {
|
||||
<span class="literal">if</span> (ar[row].<span class="ST2">length</span> > maxNumberOfColumns) {
|
||||
maxNumberOfColumns = ar[row].<span class="ST2">length</span>;
|
||||
<span class="literal">for</span> (<span class="literal">int</span> row = <span class="number">0</span>; row < ar.<span class="ST3">length</span>; ++row) {
|
||||
<span class="literal">if</span> (ar[row].<span class="ST3">length</span> > maxNumberOfColumns) {
|
||||
maxNumberOfColumns = ar[row].<span class="ST3">length</span>;
|
||||
}
|
||||
}
|
||||
|
||||
<span class="literal">return</span> maxNumberOfColumns;
|
||||
}
|
||||
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST1">printColumnMajorOrder</span>(<span class="literal">char</span>[][] ar) {
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">printColumnMajorOrder</span>(<span class="literal">char</span>[][] ar)
|
||||
{
|
||||
<span class="literal">int</span> row = <span class="number">0</span>;
|
||||
<span class="literal">int</span> column = <span class="number">0</span>;
|
||||
<span class="literal">int</span> max = <span class="ST3">maxNumberOfColumnsInJagged2dArray</span>(ar);
|
||||
<span class="literal">int</span> max = <span class="ST4">maxNumberOfColumnsInJagged2dArray</span>(ar);
|
||||
<span class="literal">for</span> (column = <span class="number">0</span>; column < max; ++column) {
|
||||
<span class="literal">for</span> (row = <span class="number">0</span>; row < ar.<span class="ST2">length</span>; ++row) {
|
||||
<span class="literal">if</span> (column < ar[row].<span class="ST2">length</span>) {
|
||||
System.<span class="ST4">out</span>.print(ar[row][column] + <span class="string">"</span> <span class="string">"</span>);
|
||||
<span class="literal">for</span> (row = <span class="number">0</span>; row < ar.<span class="ST3">length</span>; ++row) {
|
||||
<span class="literal">if</span> (column < ar[row].<span class="ST3">length</span>) {
|
||||
System.<span class="ST5">out</span>.print(ar[row][column] + <span class="string">"</span> <span class="string">"</span>);
|
||||
}
|
||||
}
|
||||
System.<span class="ST4">out</span>.println(<span class="string">"</span><span class="string">"</span>);
|
||||
System.<span class="ST5">out</span>.println(<span class="string">"</span><span class="string">"</span>);
|
||||
}
|
||||
}
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> * </span><span class="comment">Prints</span> <span class="comment">row</span> <span class="comment">by</span> <span class="comment">row</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="comment">@param</span> <span class="ST5">ar</span>
|
||||
<span class="comment"> * </span><span class="ST1">@param</span> <span class="ST6">ar</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST1">printRowMajorOrder</span>(<span class="literal">char</span>[][] ar)<span class="comment">//normal</span>
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">printRowMajorOrder</span>(<span class="literal">char</span>[][] ar)<span class="comment">//normal</span>
|
||||
{
|
||||
<span class="literal">for</span> (<span class="literal">int</span> x = <span class="number">0</span>; x < ar.<span class="ST2">length</span>; ++x) {
|
||||
<span class="literal">for</span> (<span class="literal">int</span> y = <span class="number">0</span>; y < ar[x].<span class="ST2">length</span>; ++y) {
|
||||
System.<span class="ST4">out</span>.print(ar[x][y] + <span class="string">""</span>);
|
||||
<span class="literal">for</span> (<span class="literal">int</span> x = <span class="number">0</span>; x < ar.<span class="ST3">length</span>; ++x) {
|
||||
<span class="literal">for</span> (<span class="literal">int</span> y = <span class="number">0</span>; y < ar[x].<span class="ST3">length</span>; ++y) {
|
||||
System.<span class="ST5">out</span>.print(ar[x][y] + <span class="string">""</span>);
|
||||
}
|
||||
System.<span class="ST4">out</span>.println();
|
||||
System.<span class="ST5">out</span>.println();
|
||||
}
|
||||
|
||||
}
|
||||
<span class="literal">public</span> <span class="literal">static</span> String <span class="ST2">returnRowMajorOrder</span>(<span class="literal">char</span>[] ar)<span class="comment">//normal</span>
|
||||
{
|
||||
String returnString = <span class="string">""</span>;
|
||||
<span class="literal">for</span> (<span class="literal">int</span> x = <span class="number">0</span>; x < ar.<span class="ST3">length</span>; ++x) {
|
||||
returnString += ar[x];
|
||||
}
|
||||
<span class="literal">return</span> returnString;
|
||||
}
|
||||
|
||||
<span class="comment">/**</span>
|
||||
<span class="comment"> * </span><span class="comment">Sorts</span> <span class="comment">the</span> <span class="comment">methods</span> <span class="comment">in</span> <span class="comment">ascending</span> <span class="comment">order</span> <span class="comment">using</span> <span class="comment">Selection</span> <span class="comment">Sort</span>
|
||||
<span class="comment"> *</span>
|
||||
<span class="comment"> * </span><span class="comment">@param</span> <span class="ST5">names</span> <span class="comment">the</span> <span class="comment">names</span> <span class="comment">to</span> <span class="comment">be</span> <span class="comment">sorted</span>
|
||||
<span class="comment"> * </span><span class="ST1">@param</span> <span class="ST6">names</span> <span class="comment">the</span> <span class="comment">names</span> <span class="comment">to</span> <span class="comment">be</span> <span class="comment">sorted</span>
|
||||
<span class="comment">*/</span>
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST1">sortNames</span>(<span class="literal">char</span>[][] names) {
|
||||
<span class="literal">for</span> (<span class="literal">int</span> i = <span class="number">0</span>; i < names.<span class="ST2">length</span> - <span class="number">1</span>; ++i) {
|
||||
<span class="literal">for</span> (<span class="literal">int</span> j = i + <span class="number">1</span>; j < names.<span class="ST2">length</span>; ++j) {
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">sortNames</span>(<span class="literal">char</span>[][] names)
|
||||
{
|
||||
<span class="literal">for</span> (<span class="literal">int</span> i = <span class="number">0</span>; i < names.<span class="ST3">length</span> - <span class="number">1</span>; ++i) {
|
||||
<span class="literal">for</span> (<span class="literal">int</span> j = i + <span class="number">1</span>; j < names.<span class="ST3">length</span>; ++j) {
|
||||
<span class="literal">char</span> compChar1 = names[i][<span class="number">0</span>], compChar2 = names[j][<span class="number">0</span>];
|
||||
<span class="comment">// Reoder entire row</span>
|
||||
<span class="literal">for</span> (<span class="literal">int</span> rowIterate = <span class="number">0</span>; rowIterate < <span class="ST3">maxNumberOfColumnsInJagged2dArray</span>(names); ++rowIterate) {
|
||||
<span class="literal">if</span> (Character.<span class="ST3">toLowerCase</span>(compChar1) > Character.<span class="ST3">toLowerCase</span>(compChar2)) {
|
||||
<span class="literal">for</span> (<span class="literal">int</span> rowIterate = <span class="number">1</span>; rowIterate < <span class="ST4">maxNumberOfColumnsInJagged2dArray</span>(names); ++rowIterate) {
|
||||
<span class="literal">if</span> (Character.<span class="ST4">toLowerCase</span>(compChar1) == Character.<span class="ST4">toLowerCase</span>(compChar2)) {
|
||||
<span class="literal">try</span> {
|
||||
compChar1 = names[i][rowIterate];
|
||||
compChar2 = names[j][rowIterate];
|
||||
} <span class="literal">catch</span> (Exception ex) {
|
||||
<span class="comment">// If it's failed, the index has gone out of range.</span>
|
||||
<span class="comment">// Check the length of the arrays and swap the larger one with the smaller one.</span>
|
||||
<span class="literal">if</span> (names[i].<span class="ST3">length</span> > names[j].<span class="ST3">length</span>) {
|
||||
<span class="comment">//System.out.println(names[i].length + " " + names[j].length);</span>
|
||||
<span class="comment">//System.out.println("Swapping " + returnRowMajorOrder(names[i]) + " with " + returnRowMajorOrder(names[j]));</span>
|
||||
<span class="literal">char</span>[] temp = names[i];
|
||||
names[i] = names[j];
|
||||
names[j] = temp;
|
||||
}
|
||||
<span class="literal">break</span>;
|
||||
}
|
||||
|
||||
}
|
||||
<span class="literal">if</span> (Character.<span class="ST4">toLowerCase</span>(compChar1) > Character.<span class="ST4">toLowerCase</span>(compChar2)) {
|
||||
<span class="literal">char</span>[] temp = names[i];
|
||||
names[i] = names[j];
|
||||
names[j] = temp;
|
||||
@ -97,16 +127,33 @@ table {color: #888888; background-color: #313335; font-family: monospace; font-w
|
||||
}
|
||||
}
|
||||
}
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST1">main</span>(String[] args) {
|
||||
|
||||
<span class="literal">public</span> <span class="literal">static</span> <span class="literal">void</span> <span class="ST2">main</span>(String[] args)
|
||||
{
|
||||
<span class="comment">/*</span>
|
||||
<span class="comment">char[][] names = {</span>
|
||||
<span class="comment"> {'j', 'o', 'h', 'n'},</span>
|
||||
<span class="comment"> {'a', 'n'},</span>
|
||||
<span class="comment"> {'b', 'y', 'r', 'o', 'n'},};</span>
|
||||
<span class="comment"> */</span>
|
||||
<span class="comment">///*</span>
|
||||
<span class="literal">char</span>[][] names = {
|
||||
{<span class="string">'</span><span class="string">j</span><span class="string">'</span>, <span class="string">'</span><span class="string">o</span><span class="string">'</span>, <span class="string">'</span><span class="string">h</span><span class="string">'</span>, <span class="string">'</span><span class="string">n</span><span class="string">'</span>},
|
||||
{<span class="string">'</span><span class="string">a</span><span class="string">'</span>, <span class="string">'</span><span class="string">n</span><span class="string">'</span>},
|
||||
{<span class="string">'</span><span class="string">b</span><span class="string">'</span>, <span class="string">'</span><span class="string">y</span><span class="string">'</span>, <span class="string">'</span><span class="string">r</span><span class="string">'</span>, <span class="string">'</span><span class="string">o</span><span class="string">'</span>, <span class="string">'</span><span class="string">n</span><span class="string">'</span>},};
|
||||
{<span class="string">'</span><span class="string">b</span><span class="string">'</span>, <span class="string">'</span><span class="string">y</span><span class="string">'</span>, <span class="string">'</span><span class="string">r</span><span class="string">'</span>, <span class="string">'</span><span class="string">o</span><span class="string">'</span>, <span class="string">'</span><span class="string">n</span><span class="string">'</span>},
|
||||
{<span class="string">'</span><span class="string">b</span><span class="string">'</span>, <span class="string">'</span><span class="string">y</span><span class="string">'</span>, <span class="string">'</span><span class="string">r</span><span class="string">'</span>, <span class="string">'</span><span class="string">o</span><span class="string">'</span>, <span class="string">'</span><span class="string">n</span><span class="string">'</span>, <span class="string">'</span><span class="string">i</span><span class="string">'</span>},
|
||||
{<span class="string">'</span><span class="string">a</span><span class="string">'</span>, <span class="string">'</span><span class="string">a</span><span class="string">'</span>, <span class="string">'</span><span class="string">o</span><span class="string">'</span>, <span class="string">'</span><span class="string">n</span><span class="string">'</span>},
|
||||
{<span class="string">'</span><span class="string">b</span><span class="string">'</span>, <span class="string">'</span><span class="string">b</span><span class="string">'</span>, <span class="string">'</span><span class="string">b</span><span class="string">'</span>, <span class="string">'</span><span class="string">b</span><span class="string">'</span>},
|
||||
{<span class="string">'</span><span class="string">b</span><span class="string">'</span>, <span class="string">'</span><span class="string">b</span><span class="string">'</span>, <span class="string">'</span><span class="string">b</span><span class="string">'</span>, <span class="string">'</span><span class="string">c</span><span class="string">'</span>},
|
||||
{<span class="string">'</span><span class="string">b</span><span class="string">'</span>, <span class="string">'</span><span class="string">b</span><span class="string">'</span>, <span class="string">'</span><span class="string">b</span><span class="string">'</span>}
|
||||
};
|
||||
<span class="comment">//*/</span>
|
||||
<span class="comment">//printColumnMajorOrder(names);</span>
|
||||
<span class="ST3">printRowMajorOrder</span>(names);
|
||||
System.<span class="ST4">out</span>.println();
|
||||
<span class="ST3">sortNames</span>(names);
|
||||
<span class="ST3">printRowMajorOrder</span>(names);
|
||||
<span class="ST4">printRowMajorOrder</span>(names);
|
||||
System.<span class="ST5">out</span>.println();
|
||||
<span class="ST4">sortNames</span>(names);
|
||||
<span class="comment">//System.out.println();</span>
|
||||
<span class="ST4">printRowMajorOrder</span>(names);
|
||||
<span class="comment">//printColumnMajorOrder(names);</span>
|
||||
|
||||
}
|
||||
|
@ -9,7 +9,8 @@ package com.calebfontenot.lab.d.arrays.sort_calebfontenot;
|
||||
*/
|
||||
public class Lab2DArraysSort_CalebFontenot {
|
||||
|
||||
public static int maxNumberOfColumnsInJagged2dArray(char[][] ar) {
|
||||
public static int maxNumberOfColumnsInJagged2dArray(char[][] ar)
|
||||
{
|
||||
int maxNumberOfColumns = 0;
|
||||
for (int row = 0; row < ar.length; ++row) {
|
||||
if (ar[row].length > maxNumberOfColumns) {
|
||||
@ -20,7 +21,8 @@ public class Lab2DArraysSort_CalebFontenot {
|
||||
return maxNumberOfColumns;
|
||||
}
|
||||
|
||||
public static void printColumnMajorOrder(char[][] ar) {
|
||||
public static void printColumnMajorOrder(char[][] ar)
|
||||
{
|
||||
int row = 0;
|
||||
int column = 0;
|
||||
int max = maxNumberOfColumnsInJagged2dArray(ar);
|
||||
@ -49,19 +51,47 @@ public class Lab2DArraysSort_CalebFontenot {
|
||||
}
|
||||
|
||||
}
|
||||
public static String returnRowMajorOrder(char[] ar)//normal
|
||||
{
|
||||
String returnString = "";
|
||||
for (int x = 0; x < ar.length; ++x) {
|
||||
returnString += ar[x];
|
||||
}
|
||||
return returnString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorts the methods in ascending order using Selection Sort
|
||||
*
|
||||
* @param names the names to be sorted
|
||||
*/
|
||||
public static void sortNames(char[][] names) {
|
||||
public static void sortNames(char[][] names)
|
||||
{
|
||||
for (int i = 0; i < names.length - 1; ++i) {
|
||||
for (int j = i + 1; j < names.length; ++j) {
|
||||
char compChar1 = names[i][0], compChar2 = names[j][0];
|
||||
// Reoder entire row
|
||||
for (int rowIterate = 0; rowIterate < maxNumberOfColumnsInJagged2dArray(names); ++rowIterate) {
|
||||
for (int rowIterate = 1; rowIterate < maxNumberOfColumnsInJagged2dArray(names); ++rowIterate) {
|
||||
if (Character.toLowerCase(compChar1) == Character.toLowerCase(compChar2)) {
|
||||
try {
|
||||
compChar1 = names[i][rowIterate];
|
||||
compChar2 = names[j][rowIterate];
|
||||
} catch (Exception ex) {
|
||||
// If it's failed, the index has gone out of range.
|
||||
// Check the length of the arrays and swap the larger one with the smaller one.
|
||||
if (names[i].length > names[j].length) {
|
||||
System.out.println(names[i].length + " " + names[j].length);
|
||||
System.out.println("Swapping " + returnRowMajorOrder(names[i]) + " with " + returnRowMajorOrder(names[j]));
|
||||
char[] temp = names[i];
|
||||
names[i] = names[j];
|
||||
names[j] = temp;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
if (Character.toLowerCase(compChar1) > Character.toLowerCase(compChar2)) {
|
||||
System.out.println("Swapping " + returnRowMajorOrder(names[i]) + " with " + returnRowMajorOrder(names[j]));
|
||||
char[] temp = names[i];
|
||||
names[i] = names[j];
|
||||
names[j] = temp;
|
||||
@ -70,15 +100,32 @@ public class Lab2DArraysSort_CalebFontenot {
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
char[][] names = {
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
/*
|
||||
char[][] names = {
|
||||
{'j', 'o', 'h', 'n'},
|
||||
{'a', 'n'},
|
||||
{'b', 'y', 'r', 'o', 'n'},};
|
||||
*/
|
||||
///*
|
||||
char[][] names = {
|
||||
{'j', 'o', 'h', 'n'},
|
||||
{'a', 'n'},
|
||||
{'b', 'y', 'r', 'o', 'n'},
|
||||
{'b', 'y', 'r', 'o', 'n', 'i'},
|
||||
{'a', 'a', 'o', 'n'},
|
||||
{'b', 'b', 'b', 'b'},
|
||||
{'b', 'b', 'b', 'c'},
|
||||
{'b', 'b', 'b'}
|
||||
};
|
||||
//*/
|
||||
//printColumnMajorOrder(names);
|
||||
printRowMajorOrder(names);
|
||||
System.out.println();
|
||||
sortNames(names);
|
||||
System.out.println();
|
||||
printRowMajorOrder(names);
|
||||
//printColumnMajorOrder(names);
|
||||
|
||||
|
14
Semester 2/Assignments/lab3_CalebFontenot/pom.xml
Normal file
14
Semester 2/Assignments/lab3_CalebFontenot/pom.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.calebfontenot</groupId>
|
||||
<artifactId>lab3_CalebFontenot</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<exec.mainClass>com.calebfontenot.lab3_calebfontenot.Lab3_CalebFontenot</exec.mainClass>
|
||||
</properties>
|
||||
</project>
|
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||
*/
|
||||
package com.calebfontenot.lab3_calebfontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class Employee {
|
||||
|
||||
private String name;
|
||||
|
||||
public Employee(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the value of name
|
||||
*
|
||||
* @return the value of name
|
||||
*/
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of name
|
||||
*
|
||||
* @param name new value of name
|
||||
*/
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
Employee e = new Employee();
|
||||
e.setName("John Wayne");
|
||||
System.out.println(e.getName());
|
||||
|
||||
Employee e1 = new Employee("Mary Poppins");
|
||||
System.out.println(e1.getName());
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
*/
|
||||
|
||||
package com.calebfontenot.lab3_calebfontenot;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class Lab3_CalebFontenot {
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Hello World!");
|
||||
}
|
||||
}
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user