Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
E
Executor_Service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yazan.halloul
Executor_Service
Commits
9135d9c5
Commit
9135d9c5
authored
Nov 15, 2023
by
yazan.halloul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle error create data commit
parent
88771451
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
Main.java
src/main/java/Main.java
+1
-1
RangeArrayBuilder.java
src/main/java/data/RangeArrayBuilder.java
+8
-4
No files found.
src/main/java/Main.java
View file @
9135d9c5
...
@@ -7,7 +7,7 @@ import parallelCounters.*;
...
@@ -7,7 +7,7 @@ import parallelCounters.*;
public
class
Main
{
public
class
Main
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
int
start
=
0
;
int
start
=
0
;
int
finish
=
10
;
int
finish
=
-
1
;
int
[]
data
=
RangeArrayBuilder
.
create
(
start
,
finish
);
int
[]
data
=
RangeArrayBuilder
.
create
(
start
,
finish
);
for
(
int
d:
data
for
(
int
d:
data
)
{
)
{
...
...
src/main/java/data/RangeArrayBuilder.java
View file @
9135d9c5
...
@@ -2,10 +2,14 @@ package data;
...
@@ -2,10 +2,14 @@ package data;
public
class
RangeArrayBuilder
{
public
class
RangeArrayBuilder
{
public
static
int
[]
create
(
int
start
,
int
finish
)
{
public
static
int
[]
create
(
int
start
,
int
finish
)
{
if
(
start
>
finish
)
System
.
out
.
println
(
"Error!!: Finish value should be grater than Start value"
);
else
{
int
[]
data
=
new
int
[
finish
-
start
+
1
];
int
[]
data
=
new
int
[
finish
-
start
+
1
];
for
(
int
i
=
start
;
i
<=
finish
;
i
++)
{
for
(
int
i
=
start
;
i
<=
finish
;
i
++)
{
data
[
i
-
start
]
=
i
;
data
[
i
-
start
]
=
i
;
}
}
return
data
;
return
data
;
}
}
return
new
int
[
0
];
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment