File tree Expand file tree Collapse file tree
BasicJava_2018/MonthDemo_minus_plus Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <projectDescription >
3+ <name >MonthDemo</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 >
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 1+ import java .time .Month ;
2+
3+ public class MonthDemo1
4+ {
5+ public static void main (String [] args )
6+ {
7+ Month month = Month .of (2 );
8+ System .out .println ("Before minus, Month = " +month );
9+
10+ /*
11+ * Parameters:
12+ *
13+ * months - the months to subtract, positive or negative
14+ *
15+ * Returns:
16+ *
17+ * the resulting month, not null
18+ */
19+ month = month .minus (1 );
20+ System .out .println ("After minus, Month = " +month );
21+ }
22+
23+ }
Original file line number Diff line number Diff line change 1+ import java .time .Month ;
2+
3+ public class MonthDemo2
4+ {
5+ public static void main (String [] args )
6+ {
7+ Month month = Month .of (2 );
8+ System .out .println ("Before plus, Month = " +month );
9+
10+ /*
11+ * Parameters:
12+ *
13+ * months - the months to add, positive or negative
14+ *
15+ * Returns:
16+ *
17+ * the resulting month, not null
18+ */
19+ month = month .plus (1 );
20+ System .out .println ("Before plus, Month = " +month );
21+ }
22+
23+ }
Original file line number Diff line number Diff line change 1+ Before minus, Month = FEBRUARY
2+ After minus, Month = JANUARY
Original file line number Diff line number Diff line change 1+ Before plus, Month = FEBRUARY
2+ Before plus, Month = MARCH
You can’t perform that action at this time.
0 commit comments