Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
ohj2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
aichinos
ohj2
Commits
acda22f7
Commit
acda22f7
authored
4 weeks ago
by
aichinos
Browse files
Options
Downloads
Patches
Plain Diff
ongelma löytyigit add --all!
parent
f51bed84
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mmkurssit/src/mmkurssit/Kurssit.java
+9
-3
9 additions, 3 deletions
mmkurssit/src/mmkurssit/Kurssit.java
mmkurssit/tiedot/kurssit.dat
+6
-2
6 additions, 2 deletions
mmkurssit/tiedot/kurssit.dat
with
15 additions
and
5 deletions
mmkurssit/src/mmkurssit/Kurssit.java
+
9
−
3
View file @
acda22f7
...
...
@@ -19,7 +19,7 @@ public class Kurssit {
private
int
kpl
=
0
;
private
static
String
tiedostonNimi
=
"tiedot"
;
private
static
final
int
MAX_KPL
=
5
;
//montako kurssia yhdelle taulukolle
private
static
final
int
MAX_KPL
=
10
;
//montako kurssia yhdelle taulukolle
/**
...
...
@@ -101,7 +101,7 @@ public class Kurssit {
public
void
tallenna
(
String
hakemisto
)
throws
SailoException
{
//TODO: hakemiston luominen tähän
File
ftied
=
new
File
(
hakemisto
+
"/kurssit.dat"
);
try
(
PrintStream
fileOut
=
new
PrintStream
(
new
FileOutputStream
(
ftied
,
tru
e
))){
try
(
PrintStream
fileOut
=
new
PrintStream
(
new
FileOutputStream
(
ftied
,
fals
e
))){
// true = uusi text appendoidaan vanhan tekstin perälle
for
(
int
i
=
0
;
i
<
this
.
getKpl
();
i
++)
{
Kurssi
kurssi
=
this
.
anna
(
i
);
...
...
@@ -145,6 +145,12 @@ public class Kurssit {
Kurssit
taulukko
=
new
Kurssit
();
try
{
taulukko
.
lueTiedostosta
(
"tiedot"
);
}
catch
(
SailoException
ex
)
{
System
.
err
.
println
(
ex
.
getMessage
());
}
Kurssi
japani4
=
new
Kurssi
();
japani4
.
rekisteroi
();
japani4
.
tayta
();
...
...
@@ -155,7 +161,7 @@ public class Kurssit {
try
{
taulukko
.
lisaa
(
japani4
);
taulukko
.
lisaa
(
ohjelmointi2
);
//
taulukko.lisaa(ohjelmointi2);
//taulukko.lisaa(japani4);
//taulukko.lisaa(ohjelmointi2);
//taulukko.lisaa(japani4);
...
...
This diff is collapsed.
Click to expand it.
mmkurssit/tiedot/kurssit.dat
+
6
−
2
View file @
acda22f7
1|Esimerkkikurssi22|Kokko Vesa
2|Esimerkkikurssi79|Kokko Vesa
1|Esimerkkikurssi22|Kokko Vesa
22|Esimerkkikurssi79|Kanta Natalia
34|Esimerkkikurssi22|Tanaka Sari
35|Esimerkkikurssi79|Mies nainen
1|Esimerkkikurssi22|Kokko Vesa
36|Esimerkkikurssi80|Kokko Vesa
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment