Skip to content

Commit 14b0561

Browse files
committed
nov-14
1 parent 91b17a5 commit 14b0561

78 files changed

Lines changed: 762 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
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.8"/>
5+
<classpathentry kind="output" path="bin"/>
6+
</classpath>
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>ControlFlowDemo</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.8
4+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5+
org.eclipse.jdt.core.compiler.compliance=1.8
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.8
Binary file not shown.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
class SwitchDemoFallThrough
2+
{
3+
public static void main(String[] args)
4+
{
5+
6+
/*
7+
* Each break statement terminates the enclosing switch statement.
8+
* Control flow continues with the first statement following the switch
9+
* block. The break statements are necessary because without them,
10+
* statements in switch blocks fall through: All statements after the
11+
* matching case label are executed in sequence, regardless of the
12+
* expression of subsequent case labels, until a break statement is
13+
* encountered.
14+
*/
15+
int month = 10;
16+
String monthValue;
17+
switch (month)
18+
{
19+
case 1:
20+
monthValue = "January";
21+
System.out.println("monthValue : " + monthValue);
22+
23+
case 2:
24+
monthValue = "February";
25+
System.out.println("monthValue : " + monthValue);
26+
case 3:
27+
monthValue = "March";
28+
System.out.println("monthValue : " + monthValue);
29+
30+
case 4:
31+
monthValue = "April";
32+
System.out.println("monthValue : " + monthValue);
33+
34+
case 5:
35+
monthValue = "May";
36+
System.out.println("monthValue : " + monthValue);
37+
38+
case 6:
39+
monthValue = "June";
40+
System.out.println("monthValue : " + monthValue);
41+
42+
case 7:
43+
monthValue = "July";
44+
System.out.println("monthValue : " + monthValue);
45+
46+
case 8:
47+
monthValue = "August";
48+
System.out.println("monthValue : " + monthValue);
49+
50+
case 9:
51+
monthValue = "September";
52+
System.out.println("monthValue : " + monthValue);
53+
54+
case 10:
55+
monthValue = "October";
56+
System.out.println("monthValue : " + monthValue);
57+
58+
case 11:
59+
monthValue = "November";
60+
System.out.println("monthValue : " + monthValue);
61+
62+
case 12:
63+
monthValue = "December";
64+
System.out.println("monthValue : " + monthValue);
65+
66+
default:
67+
monthValue = "Invalid month";
68+
System.out.println("monthValue : " + monthValue);
69+
70+
}
71+
System.out.println("Month is : " + monthValue);
72+
}
73+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
monthValue : October
2+
monthValue : November
3+
monthValue : December
4+
monthValue : Invalid month
5+
Month is : Invalid month
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.8"/>
5+
<classpathentry kind="output" path="bin"/>
6+
</classpath>
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>ControlFlowDemo</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.8
4+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5+
org.eclipse.jdt.core.compiler.compliance=1.8
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.8
Binary file not shown.

0 commit comments

Comments
 (0)