Skip to content

Commit 616e05d

Browse files
author
nars
committed
added initialization of array
1 parent 2fbbb0e commit 616e05d

5 files changed

Lines changed: 77 additions & 0 deletions

File tree

UnionFindAlgo/.classpath

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
5+
<classpathentry kind="output" path="bin"/>
6+
</classpath>

UnionFindAlgo/.project

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>UnionFindAlgo</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
4+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5+
org.eclipse.jdt.core.compiler.compliance=1.7
6+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
8+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
11+
org.eclipse.jdt.core.compiler.source=1.7
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package eager.QuickFind;
2+
3+
import java.util.InputMismatchException;
4+
import java.util.Scanner;
5+
6+
public class RuntimeArray {
7+
8+
private static int[] inputArray;
9+
10+
public static int readInput(){
11+
Scanner scan = new Scanner(System.in);
12+
System.out.println("enter");
13+
int readIntVal = scan.nextInt();
14+
scan.close();
15+
return readIntVal;
16+
17+
}
18+
19+
private static int[] initializeInput() {
20+
int n = 0;
21+
try {
22+
n = readInput();
23+
} catch ( InputMismatchException e) {
24+
System.out.println("invlaid integer");
25+
}
26+
int[] inputAr = new int[n];
27+
System.out.println(inputArray.length + ": is the array size");
28+
return inputAr;
29+
}
30+
public static void main(String[] args) {
31+
inputArray = initializeInput();;
32+
}
33+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package eager.exceptions;
2+
3+
public class InvalidIntegerException extends Exception{
4+
5+
/**
6+
*
7+
*/
8+
private static final long serialVersionUID = 1L;
9+
10+
}

0 commit comments

Comments
 (0)