Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
2
20231104-KursPodstawowyALX
Overview
Overview
Details
Activity
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
Patryk Czarnik
20231104-KursPodstawowyALX
Commits
754f0264
Commit
754f0264
authored
Nov 18, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
po co Internal?...
parent
579e6ee7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
BreakContinue_Prezentacja.java
...main/java/p05_petle/teoria/BreakContinue_Prezentacja.java
+4
-4
No files found.
src/main/java/p05_petle/teoria/BreakContinue_Prezentacja.java
View file @
754f0264
...
...
@@ -9,13 +9,13 @@ public class BreakContinue_Prezentacja {
while
(
true
)
{
licznik
++;
JOptionPane
.
show
Internal
MessageDialog
(
null
,
"Początek pętli, licznik = "
+
licznik
);
JOptionPane
.
showMessageDialog
(
null
,
"Początek pętli, licznik = "
+
licznik
);
int
odp1
=
JOptionPane
.
showConfirmDialog
(
null
,
"Czy zrobić break?"
);
if
(
odp1
==
JOptionPane
.
YES_OPTION
)
{
break
;
// break w pętli powoduje natychmiastowe zakończenie tej pętli i przejście do następnej instrukcji za pętlą
}
JOptionPane
.
show
Internal
MessageDialog
(
null
,
"Środek pętli. Nie było break."
);
JOptionPane
.
showMessageDialog
(
null
,
"Środek pętli. Nie było break."
);
int
odp2
=
JOptionPane
.
showConfirmDialog
(
null
,
"Czy zrobić continue?"
);
if
(
odp2
==
JOptionPane
.
YES_OPTION
)
{
...
...
@@ -23,10 +23,10 @@ public class BreakContinue_Prezentacja {
// continue powoduje pominięcie reszty instrukcji w bieżącym obrocie pętli
// i przejście od razu na początek następnego obrotu
}
JOptionPane
.
show
Internal
MessageDialog
(
null
,
"Koniec pętli, nie było break ani continue"
);
JOptionPane
.
showMessageDialog
(
null
,
"Koniec pętli, nie było break ani continue"
);
}
JOptionPane
.
show
Internal
MessageDialog
(
null
,
"Koniec programu"
);
JOptionPane
.
showMessageDialog
(
null
,
"Koniec programu"
);
}
}
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