From cfdd57dbce24aaf10089f8be58da399bb9575556 Mon Sep 17 00:00:00 2001 From: kDot Date: Tue, 12 Nov 2024 21:07:04 +0100 Subject: [PATCH] Modify numbering to four digits #2 --- S00_BoringMain.java => S0000_BoringMain.java | 2 +- S01_Executable.java => S0001_Executable.java | 2 +- ...Interface.java => S0002_MainInterface.java | 2 +- S0003_VarArgs.java | 14 +++++++++++++ S04_Timer.java => S0004_Timer.java | 2 +- ...ool.java => S0005_ScheduledThreadPool.java | 4 ++-- S06_FileWatch.java => S0006_FileWatch.java | 2 +- S07_FileDiff.java => S0007_FileDiff.java | 6 +++--- ...ipboard.java => S0008_CopyToClipboard.java | 2 +- ...board.java => S0009_ReadFromClipboard.java | 2 +- ...Console.java => S0010_ReadFromConsole.java | 2 +- ...adPassword.java => S0011_ReadPassword.java | 2 +- S12_CustomJVM.java => S0012_CustomJVM.java | 2 +- S13_Emoji.java => S0013_Emoji.java | 3 ++- ...nColor.java => S0014_SystemOutInColor.java | 2 +- ...tInLogger.java => S0015_BuiltInLogger.java | 2 +- ...Closeable.java => S0016_AutoCloseable.java | 4 ++-- ...lizer.java => S0017_StaticInitializer.java | 2 +- S0018_InitializersAndConstructors.java | 20 +++++++++++++++++++ S20_Assert.java => S0020_Assert.java | 2 +- ...inalReset.java => S0021_TerminalReset.java | 2 +- ...mat.java => S0022_CompactNumberFormat.java | 2 +- ...rs.java => S0023_UnderscoresInNumbers.java | 2 +- ...ace.java => S0024_FunctionalInterface.java | 2 +- S25_Sam.java => S0025_Sam.java | 2 +- ...ava => S0026_AttributeDefaultOptional.java | 2 +- ...ns.java => S0027_ObjectsPreconditions.java | 4 ++-- S28_Formatted.java => S0028_Formatted.java | 2 +- ...ted.java => S0029_PositionInFormatted.java | 2 +- ...Folder.java => S0030_CreateTempFolder.java | 2 +- ...ories.java => S0031_CreateDirectories.java | 2 +- ...yStream.java => S0032_DirectoryStream.java | 2 +- S33_Capitalize.java => S0033_Capitalize.java | 2 +- ...nv.java => S0034_CloudNativeSystemEnv.java | 2 +- ...LinesString.java => S0035_LinesString.java | 2 +- S37_FileCopy.java => S0037_FileCopy.java | 2 +- ...eam.java => S0038_StreamArraytoStream.java | 2 +- ...sStreams.java => S0039_EndlessStreams.java | 2 +- ...utRedirect.java => S0040_SoutRedirect.java | 2 +- ...noUnit.java => S0041_TimeVsChronoUnit.java | 2 +- ...rCaching.java => S0042_IntegerCaching.java | 2 +- S43_JWTDecoder.java => S0043_JWTDecoder.java | 2 +- S44_Ternary.java => S0044_Ternary.java | 2 +- S45_Peek.java => S0045_Peek.java | 2 +- ...yQuestion.java => S0050_CrazyQuestion.java | 2 +- S51_Frequency.java => S0051_Frequency.java | 2 +- ...InAClass.java => S0052_RecordInAClass.java | 2 +- ...va => S0053_DuplicatesFrequencyRecord.java | 2 +- ...reamConcat.java => S0054_StreamConcat.java | 2 +- S55_FlatMap.java => S0055_FlatMap.java | 4 ++-- S56_MapMulti.java => S0056_MapMulti.java | 4 ++-- ...FutureState.java => S0057_FutureState.java | 4 ++-- S0058_ShortestMain.java | 3 +++ ...nt.java => S0059_FetchAsyncHttpClient.java | 4 ++-- ...java => S0060_MagicalBeanEventHandler.java | 4 ++-- ...cords.java => S0061_SwitchWithRecords.java | 0 ...a => S0062_DestructuringNestedRecords.java | 0 ....java => S0063_ShorterInterfaceFields.java | 0 ...pyOf.java => S0064_UnmodifiableCopyOf.java | 0 ...dWasher.java => S0065_ClipboardWasher.java | 0 ...sValueOf.java => S0066_ParseVsValueOf.java | 0 ...Element.java => S0067_ListLastElement.java | 0 S68_Block.java => S0068_Block.java | 0 ...ry.java => S0069_ListFilesInDirectory.java | 0 ...g.java => S0070_LeadingZeroFormatting.java | 0 ...OStreams.java => S0071_CloseIOStreams.java | 0 ...nal.java => S0072_FlatMapWithOptional.java | 0 ...ls.java => S0073_ListOfDifferentImpls.java | 0 ...ectory.java => S0074_WorkingDirectory.java | 0 ...t-javahome.java => S0075_get-javahome.java | 0 ...nsoleYesNo.java => S0076_ConsoleYesNo.java | 2 +- ... => S0077_CreateNestedFoldersWithFile.java | 0 ...va => S0078_SystemLoggerConfiguration.java | 0 S79_AllEmojis.java => S0079_AllEmojis.java | 0 ...=> S0080_ProgrammaticallyGetClasspath.java | 0 ...IsLowerCase.java => S0081_IsLowerCase.java | 0 ...java => S0082_StringToNumberTransform.java | 0 ...ame.java => S0083_PrintEmojisWithName.java | 0 ...reams.java => S0084_ReadingIntStreams.java | 0 S85_Beep.java => S0085_Beep.java | 0 ...StringToCSV.java => S0086_StringToCSV.java | 0 ...java => S0087_DateFormatForFileNaming.java | 0 ...umAsLogger.java => S0088_EnumAsLogger.java | 0 ...onTime.java => S0089_FileCreationTime.java | 2 +- ...java => S0090_EnvEntriesWithTransform.java | 0 ...ne.java => S0091_CodeBlocksSingleLine.java | 0 ...a => S0092_BiFunctionVsBinaryOperator.java | 0 ...dList.java => S0093_FlattenNestedList.java | 0 ... S0094_FasterFilterWithParallelStream.java | 0 ...sStream.java => S0095_ForeachVsStream.java | 0 ...ava => S0096_IsAssignableVsInstanceOf.java | 0 ...java => S0097_CustomBase64Classloader.java | 0 S98_CastMethod.java => S0098_CastMethod.java | 0 ....java => S0099_MinimalisticEnumLogger.java | 0 ...ngCache.java => S0100_AutoboxingCache.java | 0 ... S0100_AutoboxingCacheSizeStartupTime.java | 0 ...alEnums.java => S0100_BehavioralEnums.java | 0 ...Cleaners.java => S0100_BrokenCleaners.java | 0 S100_Cleaners.java => S0100_Cleaners.java | 0 S100_ClockTicks.java => S0100_ClockTicks.java | 0 ...ownLatch.java => S0100_CountdownLatch.java | 0 ...Loop.java => S0100_CountdownLatchLoop.java | 0 ...h.java => S0100_CustomIterableForEach.java | 0 S100_DetectOS.java => S0100_DetectOS.java | 0 S100_EasyFiles.java => S0100_EasyFiles.java | 4 ++-- ...OInstant.java => S0100_EasyISOInstant.java | 0 ...uctors.java => S0100_EnumConstructors.java | 0 ....java => S0100_EnumDefaultConstructor.java | 0 ...tOf.java => S0100_EnumSetComplementOf.java | 0 S100_Finalizers.java => S0100_Finalizers.java | 0 ...stantParse.java => S0100_InstantParse.java | 0 ...Format.java => S0100_Java22ListFormat.java | 0 ...List.java => S0100_ListOfArraysAsList.java | 0 S100_MainInEnum.java => S0100_MainInEnum.java | 0 ...odFirst.java => S0100_MainMethodFirst.java | 0 ... S0100_MaintainabilityWithNestedEnums.java | 0 S100_NicerSleep.java => S0100_NicerSleep.java | 0 ...0_ParallelStreamForkJoinConfiguration.java | 0 ...nner.java => S0100_ParsingWithScanner.java | 0 ...Preferences.java => S0100_Preferences.java | 2 +- ...ersion.java => S0100_ReadClassVersion.java | 0 S100_clock.java => S0100_clock.java | 0 ...otEnough.java => S0101_MapOfNotEnough.java | 0 ...rowser.java => S0102_OpenURIInBrowser.java | 0 ...ss.java => S0103_AnnotationSuperclass.java | 0 S104_HtmlList.java => S0104_HtmlList.java | 0 ...cations.java => S0105_DaysToVacations.java | 0 ...utTZ.java => S0106_ToInstantWithoutTZ.java | 0 ...va => S0107_DaysToVacationsDatesUntil.java | 0 ...ekDaysEnum.java => S0108_WeekDaysEnum.java | 0 S109_MonthDay.java => S0109_MonthDay.java | 0 ...h.java => S0110_FirstMondayOfTheMonth.java | 0 ...oralQuery.java => S0111_TemporalQuery.java | 0 ...ava => S0112_ExceptionsAndAbstraction.java | 0 ...ndIf.java => S0113_NullsInSwitchAndIf.java | 0 S114_EnumToMap.java => S0114_EnumToMap.java | 0 ....java => S0115_ArraysStreamVsStreamOf.java | 0 ...> S0116_StringJoinVsCollectorsJoining.java | 0 ...MemoryUsage.java => S0117_MemoryUsage.java | 0 ...JavaRAM.java => S0118_SmallestJavaRAM.java | 0 ...mesSorry.java => S0119_1000TimesSorry.java | 0 ...a => S0120_DaysToDevoxxWithChronoUnit.java | 0 ...ing.java => S0121_GlobPatternMatching.java | 2 +- ...ava => S0122_DateTimeFormatterBuilder.java | 2 +- ...lTimeZones.java => S0123_AllTimeZones.java | 0 ....java => S0124_StringConcatWithReduce.java | 2 +- ...fLambdas.java => S0125_ArrayOfLambdas.java | 0 ...a => S0126_StreamConcatWithStringJoin.java | 4 +--- ...java => S0127_ContentEqualsOverEquals.java | 2 +- ...ngCache.java => S0128_AutoboxingCache.java | 0 ... S0129_AutoboxingCacheSizeStartupTime.java | 0 ...amIterate.java => S0130_StreamIterate.java | 0 S03_VarArgs.java | 14 ------------- S18_InitializersAndConstructors.java | 20 ------------------- S58_ShortestMain.java | 3 --- 155 files changed, 110 insertions(+), 111 deletions(-) rename S00_BoringMain.java => S0000_BoringMain.java (76%) rename S01_Executable.java => S0001_Executable.java (71%) rename S02_MainInterface.java => S0002_MainInterface.java (73%) create mode 100644 S0003_VarArgs.java rename S04_Timer.java => S0004_Timer.java (92%) rename S05_ScheduledThreadPool.java => S0005_ScheduledThreadPool.java (60%) rename S06_FileWatch.java => S0006_FileWatch.java (95%) rename S07_FileDiff.java => S0007_FileDiff.java (66%) rename S08_CopyToClipboard.java => S0008_CopyToClipboard.java (96%) rename S09_ReadFromClipboard.java => S0009_ReadFromClipboard.java (91%) rename S10_ReadFromConsole.java => S0010_ReadFromConsole.java (84%) rename S11_ReadPassword.java => S0011_ReadPassword.java (84%) rename S12_CustomJVM.java => S0012_CustomJVM.java (84%) rename S13_Emoji.java => S0013_Emoji.java (80%) rename S14_SystemOutInColor.java => S0014_SystemOutInColor.java (88%) rename S15_BuiltInLogger.java => S0015_BuiltInLogger.java (86%) rename S16_AutoCloseable.java => S0016_AutoCloseable.java (57%) rename S17_StaticInitializer.java => S0017_StaticInitializer.java (86%) create mode 100644 S0018_InitializersAndConstructors.java rename S20_Assert.java => S0020_Assert.java (87%) rename S21_TerminalReset.java => S0021_TerminalReset.java (83%) rename S22_CompactNumberFormat.java => S0022_CompactNumberFormat.java (85%) rename S23_UnderscoresInNumbers.java => S0023_UnderscoresInNumbers.java (81%) rename S24_FunctionalInterface.java => S0024_FunctionalInterface.java (51%) rename S25_Sam.java => S0025_Sam.java (84%) rename S26_AttributeDefaultOptional.java => S0026_AttributeDefaultOptional.java (93%) rename S27_ObjectsPreconditions.java => S0027_ObjectsPreconditions.java (71%) rename S28_Formatted.java => S0028_Formatted.java (85%) rename S29_PositionInFormatted.java => S0029_PositionInFormatted.java (86%) rename S30_CreateTempFolder.java => S0030_CreateTempFolder.java (85%) rename S31_CreateDirectories.java => S0031_CreateDirectories.java (86%) rename S32_DirectoryStream.java => S0032_DirectoryStream.java (92%) rename S33_Capitalize.java => S0033_Capitalize.java (88%) rename S34_CloudNativeSystemEnv.java => S0034_CloudNativeSystemEnv.java (77%) rename S35_LinesString.java => S0035_LinesString.java (91%) rename S37_FileCopy.java => S0037_FileCopy.java (88%) rename S38_StreamArraytoStream.java => S0038_StreamArraytoStream.java (87%) rename S39_EndlessStreams.java => S0039_EndlessStreams.java (90%) rename S40_SoutRedirect.java => S0040_SoutRedirect.java (89%) rename S41_TimeVsChronoUnit.java => S0041_TimeVsChronoUnit.java (88%) rename S42_IntegerCaching.java => S0042_IntegerCaching.java (90%) rename S43_JWTDecoder.java => S0043_JWTDecoder.java (94%) rename S44_Ternary.java => S0044_Ternary.java (85%) rename S45_Peek.java => S0045_Peek.java (91%) rename S50_CrazyQuestion.java => S0050_CrazyQuestion.java (85%) rename S51_Frequency.java => S0051_Frequency.java (88%) rename S52_RecordInAClass.java => S0052_RecordInAClass.java (92%) rename S53_DuplicatesFrequencyRecord.java => S0053_DuplicatesFrequencyRecord.java (92%) rename S54_StreamConcat.java => S0054_StreamConcat.java (90%) rename S55_FlatMap.java => S0055_FlatMap.java (82%) rename S56_MapMulti.java => S0056_MapMulti.java (85%) rename S57_FutureState.java => S0057_FutureState.java (88%) create mode 100644 S0058_ShortestMain.java rename S59_FetchAsyncHttpClient.java => S0059_FetchAsyncHttpClient.java (87%) rename S60_MagicalBeanEventHandler.java => S0060_MagicalBeanEventHandler.java (74%) rename S61_SwitchWithRecords.java => S0061_SwitchWithRecords.java (100%) rename S62_DestructuringNestedRecords.java => S0062_DestructuringNestedRecords.java (100%) rename S63_ShorterInterfaceFields.java => S0063_ShorterInterfaceFields.java (100%) rename S64_UnmodifiableCopyOf.java => S0064_UnmodifiableCopyOf.java (100%) rename S65_ClipboardWasher.java => S0065_ClipboardWasher.java (100%) rename S66_ParseVsValueOf.java => S0066_ParseVsValueOf.java (100%) rename S67_ListLastElement.java => S0067_ListLastElement.java (100%) rename S68_Block.java => S0068_Block.java (100%) rename S69_ListFilesInDirectory.java => S0069_ListFilesInDirectory.java (100%) rename S70_LeadingZeroFormatting.java => S0070_LeadingZeroFormatting.java (100%) rename S71_CloseIOStreams.java => S0071_CloseIOStreams.java (100%) rename S72_FlatMapWithOptional.java => S0072_FlatMapWithOptional.java (100%) rename S73_ListOfDifferentImpls.java => S0073_ListOfDifferentImpls.java (100%) rename S74_WorkingDirectory.java => S0074_WorkingDirectory.java (100%) rename S75_get-javahome.java => S0075_get-javahome.java (100%) rename S76_ConsoleYesNo.java => S0076_ConsoleYesNo.java (93%) rename S77_CreateNestedFoldersWithFile.java => S0077_CreateNestedFoldersWithFile.java (100%) rename S78_SystemLoggerConfiguration.java => S0078_SystemLoggerConfiguration.java (100%) rename S79_AllEmojis.java => S0079_AllEmojis.java (100%) rename S80_ProgrammaticallyGetClasspath.java => S0080_ProgrammaticallyGetClasspath.java (100%) rename S81_IsLowerCase.java => S0081_IsLowerCase.java (100%) rename S82_StringToNumberTransform.java => S0082_StringToNumberTransform.java (100%) rename S83_PrintEmojisWithName.java => S0083_PrintEmojisWithName.java (100%) rename S84_ReadingIntStreams.java => S0084_ReadingIntStreams.java (100%) rename S85_Beep.java => S0085_Beep.java (100%) rename S86_StringToCSV.java => S0086_StringToCSV.java (100%) rename S87_DateFormatForFileNaming.java => S0087_DateFormatForFileNaming.java (100%) rename S88_EnumAsLogger.java => S0088_EnumAsLogger.java (100%) rename S89_FileCreationTime.java => S0089_FileCreationTime.java (86%) rename S90_EnvEntriesWithTransform.java => S0090_EnvEntriesWithTransform.java (100%) rename S91_CodeBlocksSingleLine.java => S0091_CodeBlocksSingleLine.java (100%) rename S92_BiFunctionVsBinaryOperator.java => S0092_BiFunctionVsBinaryOperator.java (100%) rename S93_FlattenNestedList.java => S0093_FlattenNestedList.java (100%) rename S94_FasterFilterWithParallelStream.java => S0094_FasterFilterWithParallelStream.java (100%) rename S95_ForeachVsStream.java => S0095_ForeachVsStream.java (100%) rename S96_IsAssignableVsInstanceOf.java => S0096_IsAssignableVsInstanceOf.java (100%) rename S97_CustomBase64Classloader.java => S0097_CustomBase64Classloader.java (100%) rename S98_CastMethod.java => S0098_CastMethod.java (100%) rename S99_MinimalisticEnumLogger.java => S0099_MinimalisticEnumLogger.java (100%) rename S100_AutoboxingCache.java => S0100_AutoboxingCache.java (100%) rename S100_AutoboxingCacheSizeStartupTime.java => S0100_AutoboxingCacheSizeStartupTime.java (100%) rename S100_BehavioralEnums.java => S0100_BehavioralEnums.java (100%) rename S100_BrokenCleaners.java => S0100_BrokenCleaners.java (100%) rename S100_Cleaners.java => S0100_Cleaners.java (100%) rename S100_ClockTicks.java => S0100_ClockTicks.java (100%) rename S100_CountdownLatch.java => S0100_CountdownLatch.java (100%) rename S100_CountdownLatchLoop.java => S0100_CountdownLatchLoop.java (100%) rename S100_CustomIterableForEach.java => S0100_CustomIterableForEach.java (100%) rename S100_DetectOS.java => S0100_DetectOS.java (100%) rename S100_EasyFiles.java => S0100_EasyFiles.java (69%) rename S100_EasyISOInstant.java => S0100_EasyISOInstant.java (100%) rename S100_EnumConstructors.java => S0100_EnumConstructors.java (100%) rename S100_EnumDefaultConstructor.java => S0100_EnumDefaultConstructor.java (100%) rename S100_EnumSetComplementOf.java => S0100_EnumSetComplementOf.java (100%) rename S100_Finalizers.java => S0100_Finalizers.java (100%) rename S100_InstantParse.java => S0100_InstantParse.java (100%) rename S100_Java22ListFormat.java => S0100_Java22ListFormat.java (100%) rename S100_ListOfArraysAsList.java => S0100_ListOfArraysAsList.java (100%) rename S100_MainInEnum.java => S0100_MainInEnum.java (100%) rename S100_MainMethodFirst.java => S0100_MainMethodFirst.java (100%) rename S100_MaintainabilityWithNestedEnums.java => S0100_MaintainabilityWithNestedEnums.java (100%) rename S100_NicerSleep.java => S0100_NicerSleep.java (100%) rename S100_ParallelStreamForkJoinConfiguration.java => S0100_ParallelStreamForkJoinConfiguration.java (100%) rename S100_ParsingWithScanner.java => S0100_ParsingWithScanner.java (100%) rename S100_Preferences.java => S0100_Preferences.java (92%) rename S100_ReadClassVersion.java => S0100_ReadClassVersion.java (100%) rename S100_clock.java => S0100_clock.java (100%) rename S101_MapOfNotEnough.java => S0101_MapOfNotEnough.java (100%) rename S102_OpenURIInBrowser.java => S0102_OpenURIInBrowser.java (100%) rename S103_AnnotationSuperclass.java => S0103_AnnotationSuperclass.java (100%) rename S104_HtmlList.java => S0104_HtmlList.java (100%) rename S105_DaysToVacations.java => S0105_DaysToVacations.java (100%) rename S106_ToInstantWithoutTZ.java => S0106_ToInstantWithoutTZ.java (100%) rename S107_DaysToVacationsDatesUntil.java => S0107_DaysToVacationsDatesUntil.java (100%) rename S108_WeekDaysEnum.java => S0108_WeekDaysEnum.java (100%) rename S109_MonthDay.java => S0109_MonthDay.java (100%) rename S110_FirstMondayOfTheMonth.java => S0110_FirstMondayOfTheMonth.java (100%) rename S111_TemporalQuery.java => S0111_TemporalQuery.java (100%) rename S112_ExceptionsAndAbstraction.java => S0112_ExceptionsAndAbstraction.java (100%) rename S113_NullsInSwitchAndIf.java => S0113_NullsInSwitchAndIf.java (100%) rename S114_EnumToMap.java => S0114_EnumToMap.java (100%) rename S115_ArraysStreamVsStreamOf.java => S0115_ArraysStreamVsStreamOf.java (100%) rename S116_StringJoinVsCollectorsJoining.java => S0116_StringJoinVsCollectorsJoining.java (100%) rename S117_MemoryUsage.java => S0117_MemoryUsage.java (100%) rename S118_SmallestJavaRAM.java => S0118_SmallestJavaRAM.java (100%) rename S119_1000TimesSorry.java => S0119_1000TimesSorry.java (100%) rename S120_DaysToDevoxxWithChronoUnit.java => S0120_DaysToDevoxxWithChronoUnit.java (100%) rename S121_GlobPatternMatching.java => S0121_GlobPatternMatching.java (90%) rename S122_DateTimeFormatterBuilder.java => S0122_DateTimeFormatterBuilder.java (95%) rename S123_AllTimeZones.java => S0123_AllTimeZones.java (100%) rename S124_StringConcatWithReduce.java => S0124_StringConcatWithReduce.java (85%) rename S125_ArrayOfLambdas.java => S0125_ArrayOfLambdas.java (100%) rename S126_StreamConcatWithStringJoin.java => S0126_StreamConcatWithStringJoin.java (83%) rename S127_ContentEqualsOverEquals.java => S0127_ContentEqualsOverEquals.java (79%) rename S128_AutoboxingCache.java => S0128_AutoboxingCache.java (100%) rename S129_AutoboxingCacheSizeStartupTime.java => S0129_AutoboxingCacheSizeStartupTime.java (100%) rename S130_StreamIterate.java => S0130_StreamIterate.java (100%) delete mode 100644 S03_VarArgs.java delete mode 100644 S18_InitializersAndConstructors.java delete mode 100644 S58_ShortestMain.java diff --git a/S00_BoringMain.java b/S0000_BoringMain.java similarity index 76% rename from S00_BoringMain.java rename to S0000_BoringMain.java index ccaefc2..9a884ca 100644 --- a/S00_BoringMain.java +++ b/S0000_BoringMain.java @@ -1,4 +1,4 @@ -public class S00_BoringMain { +public class S0000_BoringMain { public static void main(String[] args) { System.out.println("boring and complex"); diff --git a/S01_Executable.java b/S0001_Executable.java similarity index 71% rename from S01_Executable.java rename to S0001_Executable.java index 6eb5c51..f5c9e91 100644 --- a/S01_Executable.java +++ b/S0001_Executable.java @@ -1,4 +1,4 @@ -public interface S01_Executable { +public interface S0001_Executable { static void main(String... args) { System.out.println("hello,duke"); diff --git a/S02_MainInterface.java b/S0002_MainInterface.java similarity index 73% rename from S02_MainInterface.java rename to S0002_MainInterface.java index c4cfe74..3fcd2b3 100644 --- a/S02_MainInterface.java +++ b/S0002_MainInterface.java @@ -1,4 +1,4 @@ -interface S02_MainInterface { +interface S0002_MainInterface { static void main(String... args) { System.out.println("hello,duke"); diff --git a/S0003_VarArgs.java b/S0003_VarArgs.java new file mode 100644 index 0000000..b855500 --- /dev/null +++ b/S0003_VarArgs.java @@ -0,0 +1,14 @@ +interface S0003_VarArgs { + + static void hello(String... messages) { + for (var message : messages) { + System.out.println(message); + } + } + + static void main(String... args) { + S0003_VarArgs.hello("hey", "duke", "java"); + S0003_VarArgs.hello("is", "working"); + S0003_VarArgs.hello(new String[] { "is", "always", "working" }); + } +} \ No newline at end of file diff --git a/S04_Timer.java b/S0004_Timer.java similarity index 92% rename from S04_Timer.java rename to S0004_Timer.java index bbab80d..500cb51 100644 --- a/S04_Timer.java +++ b/S0004_Timer.java @@ -1,7 +1,7 @@ import java.util.Timer; import java.util.TimerTask; -public class S04_Timer { +public class S0004_Timer { public static void main(String[] args) { var task = new TimerTask() { diff --git a/S05_ScheduledThreadPool.java b/S0005_ScheduledThreadPool.java similarity index 60% rename from S05_ScheduledThreadPool.java rename to S0005_ScheduledThreadPool.java index 0a248ae..2183409 100644 --- a/S05_ScheduledThreadPool.java +++ b/S0005_ScheduledThreadPool.java @@ -1,11 +1,11 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; -interface S05_ScheduledThreadPool { +interface S0005_ScheduledThreadPool { static void main(String... args) { var scheduler = Executors.newScheduledThreadPool(1); scheduler - .scheduleAtFixedRate(()-> System.out.println("hello"), 0, 1, TimeUnit.SECONDS); + .scheduleAtFixedRate(() -> System.out.println("hello"), 0, 1, TimeUnit.SECONDS); } } \ No newline at end of file diff --git a/S06_FileWatch.java b/S0006_FileWatch.java similarity index 95% rename from S06_FileWatch.java rename to S0006_FileWatch.java index 14a84f0..4ce8044 100644 --- a/S06_FileWatch.java +++ b/S0006_FileWatch.java @@ -3,7 +3,7 @@ import java.nio.file.StandardWatchEventKinds; import java.nio.file.WatchEvent; -interface S06_FileWatch { +interface S0006_FileWatch { static void main(String... args) throws Exception { diff --git a/S07_FileDiff.java b/S0007_FileDiff.java similarity index 66% rename from S07_FileDiff.java rename to S0007_FileDiff.java index c6c231b..47f3b1b 100644 --- a/S07_FileDiff.java +++ b/S0007_FileDiff.java @@ -2,11 +2,11 @@ import java.nio.file.Files; import java.nio.file.Path; -interface S07_FileDiff { +interface S0007_FileDiff { static void main(String... args) throws IOException { - var first = Path.of("a.txt"); - var second = Path.of("b.txt"); + var first = Path.of("S0000_BoringMain.java"); + var second = Path.of("S0001_Executable.java"); var firstDifferentByte = Files.mismatch(first, second); System.out.println(firstDifferentByte); diff --git a/S08_CopyToClipboard.java b/S0008_CopyToClipboard.java similarity index 96% rename from S08_CopyToClipboard.java rename to S0008_CopyToClipboard.java index 9e58826..154b871 100644 --- a/S08_CopyToClipboard.java +++ b/S0008_CopyToClipboard.java @@ -4,7 +4,7 @@ import java.awt.datatransfer.UnsupportedFlavorException; import java.io.IOException; -public class S08_CopyToClipboard { +public class S0008_CopyToClipboard { public static void main(String[] args) { var message = "from java " + System.nanoTime(); diff --git a/S09_ReadFromClipboard.java b/S0009_ReadFromClipboard.java similarity index 91% rename from S09_ReadFromClipboard.java rename to S0009_ReadFromClipboard.java index 238f8b3..e8a122e 100644 --- a/S09_ReadFromClipboard.java +++ b/S0009_ReadFromClipboard.java @@ -3,7 +3,7 @@ import java.awt.datatransfer.UnsupportedFlavorException; import java.io.IOException; -public class S09_ReadFromClipboard { +public class S0009_ReadFromClipboard { public static void main(String[] args) throws UnsupportedFlavorException, IOException { var cb = Toolkit.getDefaultToolkit().getSystemClipboard(); diff --git a/S10_ReadFromConsole.java b/S0010_ReadFromConsole.java similarity index 84% rename from S10_ReadFromConsole.java rename to S0010_ReadFromConsole.java index e527880..8226d4a 100644 --- a/S10_ReadFromConsole.java +++ b/S0010_ReadFromConsole.java @@ -1,4 +1,4 @@ -public class S10_ReadFromConsole { +public class S0010_ReadFromConsole { public static void main(String[] args) { var console = System.console(); diff --git a/S11_ReadPassword.java b/S0011_ReadPassword.java similarity index 84% rename from S11_ReadPassword.java rename to S0011_ReadPassword.java index b854161..20c9d20 100644 --- a/S11_ReadPassword.java +++ b/S0011_ReadPassword.java @@ -1,4 +1,4 @@ -public class S11_ReadPassword { +public class S0011_ReadPassword { public static void main(String[] args) { var console = System.console(); diff --git a/S12_CustomJVM.java b/S0012_CustomJVM.java similarity index 84% rename from S12_CustomJVM.java rename to S0012_CustomJVM.java index 92ab6a6..7c1d8cc 100644 --- a/S12_CustomJVM.java +++ b/S0012_CustomJVM.java @@ -1,4 +1,4 @@ -public interface S12_CustomJVM { +public interface S0012_CustomJVM { /** * javac diff --git a/S13_Emoji.java b/S0013_Emoji.java similarity index 80% rename from S13_Emoji.java rename to S0013_Emoji.java index 6283292..cb119f4 100644 --- a/S13_Emoji.java +++ b/S0013_Emoji.java @@ -1,4 +1,5 @@ -public class S13_Emoji { +public class S0013_Emoji { + static final String ROCKET = "🚀"; public static void main(String[] args) { diff --git a/S14_SystemOutInColor.java b/S0014_SystemOutInColor.java similarity index 88% rename from S14_SystemOutInColor.java rename to S0014_SystemOutInColor.java index a9bb3ce..d627963 100644 --- a/S14_SystemOutInColor.java +++ b/S0014_SystemOutInColor.java @@ -2,7 +2,7 @@ /** * https://en.wikipedia.org/wiki/ANSI_escape_code */ -interface S14_SystemOutInColor { +interface S0014_SystemOutInColor { static void main(String... args) { System.out.println("\033[0;31mhello, duke"); diff --git a/S15_BuiltInLogger.java b/S0015_BuiltInLogger.java similarity index 86% rename from S15_BuiltInLogger.java rename to S0015_BuiltInLogger.java index 4fabffd..98208ee 100644 --- a/S15_BuiltInLogger.java +++ b/S0015_BuiltInLogger.java @@ -1,6 +1,6 @@ import java.lang.System.Logger.Level; -public class S15_BuiltInLogger { +public class S0015_BuiltInLogger { public static void main(String[] args) { var log = System.getLogger("duke"); log.log(Level.INFO, "hello, world"); diff --git a/S16_AutoCloseable.java b/S0016_AutoCloseable.java similarity index 57% rename from S16_AutoCloseable.java rename to S0016_AutoCloseable.java index 3a67e9f..4a85b49 100644 --- a/S16_AutoCloseable.java +++ b/S0016_AutoCloseable.java @@ -1,11 +1,11 @@ -public class S16_AutoCloseable implements AutoCloseable { +public class S0016_AutoCloseable implements AutoCloseable { @Override public void close() { System.out.println("closing"); } public static void main(String[] args) { - try (var a = new S16_AutoCloseable()) { + try (var a = new S0016_AutoCloseable()) { } } diff --git a/S17_StaticInitializer.java b/S0017_StaticInitializer.java similarity index 86% rename from S17_StaticInitializer.java rename to S0017_StaticInitializer.java index c49104b..3544a70 100644 --- a/S17_StaticInitializer.java +++ b/S0017_StaticInitializer.java @@ -1,4 +1,4 @@ -class S17_StaticInitializer{ +class S0017_StaticInitializer{ static{ System.out.println("s1"); } diff --git a/S0018_InitializersAndConstructors.java b/S0018_InitializersAndConstructors.java new file mode 100644 index 0000000..0d30386 --- /dev/null +++ b/S0018_InitializersAndConstructors.java @@ -0,0 +1,20 @@ +public class S0018_InitializersAndConstructors { + + public S0018_InitializersAndConstructors() { + System.out.println("parameterless"); + } + + public S0018_InitializersAndConstructors(String name) { + System.out.println(name); + } + + { + System.out.println("shared code"); + } + + + public static void main(String[] args) { + new S0018_InitializersAndConstructors(); + new S0018_InitializersAndConstructors("with parameter"); + } +} \ No newline at end of file diff --git a/S20_Assert.java b/S0020_Assert.java similarity index 87% rename from S20_Assert.java rename to S0020_Assert.java index 85431f2..009f57c 100644 --- a/S20_Assert.java +++ b/S0020_Assert.java @@ -1,7 +1,7 @@ import java.util.Objects; //-ea -public class S20_Assert { +public class S0020_Assert { static void parameterNeeded(String input) { assert input != null; diff --git a/S21_TerminalReset.java b/S0021_TerminalReset.java similarity index 83% rename from S21_TerminalReset.java rename to S0021_TerminalReset.java index 4ca30b8..80109a3 100644 --- a/S21_TerminalReset.java +++ b/S0021_TerminalReset.java @@ -1,6 +1,6 @@ import java.io.IOException; -interface S21_TerminalReset { +interface S0021_TerminalReset { static void main(String... args) throws IOException { System.out.println("duke is not nice"); diff --git a/S22_CompactNumberFormat.java b/S0022_CompactNumberFormat.java similarity index 85% rename from S22_CompactNumberFormat.java rename to S0022_CompactNumberFormat.java index 21c48b8..4872fce 100644 --- a/S22_CompactNumberFormat.java +++ b/S0022_CompactNumberFormat.java @@ -1,6 +1,6 @@ import java.text.NumberFormat; -public class S22_CompactNumberFormat { +public class S0022_CompactNumberFormat { public static void main(String[] args) { var number = 10000; diff --git a/S23_UnderscoresInNumbers.java b/S0023_UnderscoresInNumbers.java similarity index 81% rename from S23_UnderscoresInNumbers.java rename to S0023_UnderscoresInNumbers.java index 0826e0b..54074a8 100644 --- a/S23_UnderscoresInNumbers.java +++ b/S0023_UnderscoresInNumbers.java @@ -1,4 +1,4 @@ -public class S23_UnderscoresInNumbers { +public class S0023_UnderscoresInNumbers { public static void main(String[] args) { var number = 10_000_000; diff --git a/S24_FunctionalInterface.java b/S0024_FunctionalInterface.java similarity index 51% rename from S24_FunctionalInterface.java rename to S0024_FunctionalInterface.java index 165c6c2..c203698 100644 --- a/S24_FunctionalInterface.java +++ b/S0024_FunctionalInterface.java @@ -1,5 +1,5 @@ @FunctionalInterface -interface S24_FunctionalInterface { +interface S0024_FunctionalInterface { void first(); } \ No newline at end of file diff --git a/S25_Sam.java b/S0025_Sam.java similarity index 84% rename from S25_Sam.java rename to S0025_Sam.java index ff9c635..5ca3611 100644 --- a/S25_Sam.java +++ b/S0025_Sam.java @@ -1,4 +1,4 @@ -public class S25_Sam { +public class S0025_Sam { public static void main(String[] args) { Runnable r = () -> System.out.println("working"); new Thread(r).start(); diff --git a/S26_AttributeDefaultOptional.java b/S0026_AttributeDefaultOptional.java similarity index 93% rename from S26_AttributeDefaultOptional.java rename to S0026_AttributeDefaultOptional.java index 1f1f16c..eb8fcc4 100644 --- a/S26_AttributeDefaultOptional.java +++ b/S0026_AttributeDefaultOptional.java @@ -1,6 +1,6 @@ import static java.util.Optional.ofNullable; -interface S26_AttributeDefaultOptional { +interface S0026_AttributeDefaultOptional { class Developer { private String name; diff --git a/S27_ObjectsPreconditions.java b/S0027_ObjectsPreconditions.java similarity index 71% rename from S27_ObjectsPreconditions.java rename to S0027_ObjectsPreconditions.java index 093fca6..413c4cc 100644 --- a/S27_ObjectsPreconditions.java +++ b/S0027_ObjectsPreconditions.java @@ -1,14 +1,14 @@ import java.time.LocalDateTime; import java.util.Objects; -public class S27_ObjectsPreconditions { +public class S0027_ObjectsPreconditions { static String error() { return "input please now: " + LocalDateTime.now(); } static void parameterPlease(String input) { - Objects.requireNonNull(input, S27_ObjectsPreconditions::error); + Objects.requireNonNull(input, S0027_ObjectsPreconditions::error); } public static void main(String[] args) { diff --git a/S28_Formatted.java b/S0028_Formatted.java similarity index 85% rename from S28_Formatted.java rename to S0028_Formatted.java index f84a9b8..d8c12ff 100644 --- a/S28_Formatted.java +++ b/S0028_Formatted.java @@ -1,4 +1,4 @@ -public class S28_Formatted { +public class S0028_Formatted { public static void main(String[] args) { var message = """ diff --git a/S29_PositionInFormatted.java b/S0029_PositionInFormatted.java similarity index 86% rename from S29_PositionInFormatted.java rename to S0029_PositionInFormatted.java index b7fcd7d..72f45ea 100644 --- a/S29_PositionInFormatted.java +++ b/S0029_PositionInFormatted.java @@ -1,4 +1,4 @@ -public class S29_PositionInFormatted { +public class S0029_PositionInFormatted { public static void main(String[] args) { var message = """ diff --git a/S30_CreateTempFolder.java b/S0030_CreateTempFolder.java similarity index 85% rename from S30_CreateTempFolder.java rename to S0030_CreateTempFolder.java index 79b91f2..95e59fd 100644 --- a/S30_CreateTempFolder.java +++ b/S0030_CreateTempFolder.java @@ -1,7 +1,7 @@ import java.io.IOException; import java.nio.file.Files; -public class S30_CreateTempFolder { +public class S0030_CreateTempFolder { public static void main(String[] args) throws IOException { var temp = Files.createTempDirectory("airhacks"); diff --git a/S31_CreateDirectories.java b/S0031_CreateDirectories.java similarity index 86% rename from S31_CreateDirectories.java rename to S0031_CreateDirectories.java index 66f811d..608012c 100644 --- a/S31_CreateDirectories.java +++ b/S0031_CreateDirectories.java @@ -2,7 +2,7 @@ import java.nio.file.Files; import java.nio.file.Path; -public class S31_CreateDirectories { +public class S0031_CreateDirectories { public static void main(String[] args) throws IOException { var path = Path.of("hello/duke/rocks"); diff --git a/S32_DirectoryStream.java b/S0032_DirectoryStream.java similarity index 92% rename from S32_DirectoryStream.java rename to S0032_DirectoryStream.java index a9f45b1..9c517c7 100644 --- a/S32_DirectoryStream.java +++ b/S0032_DirectoryStream.java @@ -2,7 +2,7 @@ import java.nio.file.Files; import java.nio.file.Path; -public class S32_DirectoryStream { +public class S0032_DirectoryStream { static void createDirectories() throws IOException { for (int i = 0; i < 10; i++) { diff --git a/S33_Capitalize.java b/S0033_Capitalize.java similarity index 88% rename from S33_Capitalize.java rename to S0033_Capitalize.java index 4d9d0d8..e042a41 100644 --- a/S33_Capitalize.java +++ b/S0033_Capitalize.java @@ -1,4 +1,4 @@ -interface S33_Capitalize { +interface S0033_Capitalize { static String cap(String name) { var first = Character.toUpperCase(name.charAt(0)); var rem = name.substring(1); diff --git a/S34_CloudNativeSystemEnv.java b/S0034_CloudNativeSystemEnv.java similarity index 77% rename from S34_CloudNativeSystemEnv.java rename to S0034_CloudNativeSystemEnv.java index ec0cb46..05a80f0 100644 --- a/S34_CloudNativeSystemEnv.java +++ b/S0034_CloudNativeSystemEnv.java @@ -1,4 +1,4 @@ -public class S34_CloudNativeSystemEnv { +public class S0034_CloudNativeSystemEnv { public static void main(String[] args) { var home = System.getenv().get("JAVA_HOME"); diff --git a/S35_LinesString.java b/S0035_LinesString.java similarity index 91% rename from S35_LinesString.java rename to S0035_LinesString.java index 15eefce..9bca132 100644 --- a/S35_LinesString.java +++ b/S0035_LinesString.java @@ -1,4 +1,4 @@ -public class S35_LinesString { +public class S0035_LinesString { public static void main(String[] args) { var result = """ diff --git a/S37_FileCopy.java b/S0037_FileCopy.java similarity index 88% rename from S37_FileCopy.java rename to S0037_FileCopy.java index 85c06bf..a1fd9e1 100644 --- a/S37_FileCopy.java +++ b/S0037_FileCopy.java @@ -2,7 +2,7 @@ import static java.nio.file.Path.*; import java.io.IOException; -interface S37_FileCopy { +interface S0037_FileCopy { static void main(String... args) throws IOException { Files.copy(of("App.java"), of("App.next")); } diff --git a/S38_StreamArraytoStream.java b/S0038_StreamArraytoStream.java similarity index 87% rename from S38_StreamArraytoStream.java rename to S0038_StreamArraytoStream.java index 59a07d9..7040e64 100644 --- a/S38_StreamArraytoStream.java +++ b/S0038_StreamArraytoStream.java @@ -1,7 +1,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -public class S38_StreamArraytoStream { +public class S0038_StreamArraytoStream { public static void main(String[] args) { var stringArgs = Stream diff --git a/S39_EndlessStreams.java b/S0039_EndlessStreams.java similarity index 90% rename from S39_EndlessStreams.java rename to S0039_EndlessStreams.java index 7e52f7d..8629b0f 100644 --- a/S39_EndlessStreams.java +++ b/S0039_EndlessStreams.java @@ -1,7 +1,7 @@ import java.time.LocalDateTime; import java.util.stream.Stream; -interface S39_EndlessStreams { +interface S0039_EndlessStreams { static void main(String... args) { var dates = Stream diff --git a/S40_SoutRedirect.java b/S0040_SoutRedirect.java similarity index 89% rename from S40_SoutRedirect.java rename to S0040_SoutRedirect.java index f4e14b1..345ab75 100644 --- a/S40_SoutRedirect.java +++ b/S0040_SoutRedirect.java @@ -4,7 +4,7 @@ /** * App */ -public class S40_SoutRedirect { +public class S0040_SoutRedirect { public static void main(String[] args) throws FileNotFoundException { var s = new PrintStream("log.file"); diff --git a/S41_TimeVsChronoUnit.java b/S0041_TimeVsChronoUnit.java similarity index 88% rename from S41_TimeVsChronoUnit.java rename to S0041_TimeVsChronoUnit.java index c027005..94efc00 100644 --- a/S41_TimeVsChronoUnit.java +++ b/S0041_TimeVsChronoUnit.java @@ -1,7 +1,7 @@ import java.time.temporal.ChronoUnit; import java.util.concurrent.TimeUnit; -interface S41_TimeVsChronoUnit { +interface S0041_TimeVsChronoUnit { static void main(String... args) throws InterruptedException { System.out.println("what's the difference?"); diff --git a/S42_IntegerCaching.java b/S0042_IntegerCaching.java similarity index 90% rename from S42_IntegerCaching.java rename to S0042_IntegerCaching.java index 0b8e6ff..3654205 100644 --- a/S42_IntegerCaching.java +++ b/S0042_IntegerCaching.java @@ -1,4 +1,4 @@ -interface S42_IntegerCaching { +interface S0042_IntegerCaching { static void main(String... args) { var number = 128; diff --git a/S43_JWTDecoder.java b/S0043_JWTDecoder.java similarity index 94% rename from S43_JWTDecoder.java rename to S0043_JWTDecoder.java index 5f36a78..048310d 100644 --- a/S43_JWTDecoder.java +++ b/S0043_JWTDecoder.java @@ -2,7 +2,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -interface S43_JWTDecoder { +interface S0043_JWTDecoder { static void main(String... args) { var parts = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" diff --git a/S44_Ternary.java b/S0044_Ternary.java similarity index 85% rename from S44_Ternary.java rename to S0044_Ternary.java index 5533eab..a1d54b9 100644 --- a/S44_Ternary.java +++ b/S0044_Ternary.java @@ -1,4 +1,4 @@ -interface S44_Ternary { +interface S0044_Ternary { static void main(String... args) { var input = ""; diff --git a/S45_Peek.java b/S0045_Peek.java similarity index 91% rename from S45_Peek.java rename to S0045_Peek.java index e5c6df5..8fce4d1 100644 --- a/S45_Peek.java +++ b/S0045_Peek.java @@ -1,6 +1,6 @@ import java.util.List; -public class S45_Peek { +public class S0045_Peek { public static void main(String[] args) { var result = List.of("a", "b", "c") .stream() diff --git a/S50_CrazyQuestion.java b/S0050_CrazyQuestion.java similarity index 85% rename from S50_CrazyQuestion.java rename to S0050_CrazyQuestion.java index f1b87d8..260f61d 100644 --- a/S50_CrazyQuestion.java +++ b/S0050_CrazyQuestion.java @@ -1,4 +1,4 @@ -interface S50_CrazyQuestion { +interface S0050_CrazyQuestion { static void main(String... args) { diff --git a/S51_Frequency.java b/S0051_Frequency.java similarity index 88% rename from S51_Frequency.java rename to S0051_Frequency.java index 9c56991..aca6ff9 100644 --- a/S51_Frequency.java +++ b/S0051_Frequency.java @@ -1,7 +1,7 @@ import java.util.Collections; import java.util.List; -interface S51_Frequency { +interface S0051_Frequency { static void main(String... args) { var numbers = List.of(1,2,2,2,3,3,3); diff --git a/S52_RecordInAClass.java b/S0052_RecordInAClass.java similarity index 92% rename from S52_RecordInAClass.java rename to S0052_RecordInAClass.java index b2c644a..26b004f 100644 --- a/S52_RecordInAClass.java +++ b/S0052_RecordInAClass.java @@ -1,6 +1,6 @@ import java.util.stream.Stream; -public class S52_RecordInAClass { +public class S0052_RecordInAClass { public static void main(String[] args) { record Flag(String flag) { diff --git a/S53_DuplicatesFrequencyRecord.java b/S0053_DuplicatesFrequencyRecord.java similarity index 92% rename from S53_DuplicatesFrequencyRecord.java rename to S0053_DuplicatesFrequencyRecord.java index 6ae81bc..29695fa 100644 --- a/S53_DuplicatesFrequencyRecord.java +++ b/S0053_DuplicatesFrequencyRecord.java @@ -1,7 +1,7 @@ import java.util.List; import static java.util.Collections.frequency; -interface S53_DuplicatesFrequencyRecord { +interface S0053_DuplicatesFrequencyRecord { static void main(String... args) { var numbers = List.of(1, 2, 3, 3, 4, 3, 1, 2); diff --git a/S54_StreamConcat.java b/S0054_StreamConcat.java similarity index 90% rename from S54_StreamConcat.java rename to S0054_StreamConcat.java index 6d17520..6a75fcd 100644 --- a/S54_StreamConcat.java +++ b/S0054_StreamConcat.java @@ -1,7 +1,7 @@ import java.util.List; import java.util.stream.Stream; -public class S54_StreamConcat { +public class S0054_StreamConcat { public static void main(String[] args) { var first = List.of("1", "2").stream(); diff --git a/S55_FlatMap.java b/S0055_FlatMap.java similarity index 82% rename from S55_FlatMap.java rename to S0055_FlatMap.java index 110a0d1..29b4d15 100644 --- a/S55_FlatMap.java +++ b/S0055_FlatMap.java @@ -1,6 +1,6 @@ import java.util.stream.Stream; -public class S55_FlatMap { +public class S0055_FlatMap { static Stream addPrefix(String prefix) { return Stream @@ -11,7 +11,7 @@ static Stream addPrefix(String prefix) { public static void main(String[] args) { var messages = Stream .of("hey", "hi") - .flatMap(S55_FlatMap::addPrefix) + .flatMap(S0055_FlatMap::addPrefix) .toList(); System.out.println(messages); diff --git a/S56_MapMulti.java b/S0056_MapMulti.java similarity index 85% rename from S56_MapMulti.java rename to S0056_MapMulti.java index 8c68901..1a465ec 100644 --- a/S56_MapMulti.java +++ b/S0056_MapMulti.java @@ -1,7 +1,7 @@ import java.util.function.Consumer; import java.util.stream.Stream; -interface S56_MapMulti { +interface S0056_MapMulti { // 1 -> n static void expand(String csv, @@ -15,7 +15,7 @@ static void main(String... args) { .of("hello,world", "duke,java"); var expanded = csv - .mapMulti(S56_MapMulti::expand) + .mapMulti(S0056_MapMulti::expand) .toList(); System.out.println(expanded); } diff --git a/S57_FutureState.java b/S0057_FutureState.java similarity index 88% rename from S57_FutureState.java rename to S0057_FutureState.java index bf5eec4..b6563f9 100644 --- a/S57_FutureState.java +++ b/S0057_FutureState.java @@ -2,7 +2,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; -interface S57_FutureState { +interface S0057_FutureState { static String slowMessage() { try { @@ -15,7 +15,7 @@ static String slowMessage() { static void main(String... args) throws InterruptedException, ExecutionException { var future = Executors .newCachedThreadPool() - .submit(S57_FutureState::slowMessage); + .submit(S0057_FutureState::slowMessage); System.out.println(future.state()); TimeUnit.SECONDS.sleep(1); diff --git a/S0058_ShortestMain.java b/S0058_ShortestMain.java new file mode 100644 index 0000000..19f4c33 --- /dev/null +++ b/S0058_ShortestMain.java @@ -0,0 +1,3 @@ +void main() { + System.out.println("hello, world"); +} \ No newline at end of file diff --git a/S59_FetchAsyncHttpClient.java b/S0059_FetchAsyncHttpClient.java similarity index 87% rename from S59_FetchAsyncHttpClient.java rename to S0059_FetchAsyncHttpClient.java index 01c1fb0..958c85b 100644 --- a/S59_FetchAsyncHttpClient.java +++ b/S0059_FetchAsyncHttpClient.java @@ -5,7 +5,7 @@ import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; -interface S59_FetchAsyncHttpClient { +interface S0059_FetchAsyncHttpClient { static void onFetch(String content) { System.out.println(content); @@ -19,7 +19,7 @@ static void fetch(URI uri) throws Exception { httpClient .sendAsync(req, BodyHandlers.ofString()) .thenApply(HttpResponse::body) - .thenAccept(S59_FetchAsyncHttpClient::onFetch); + .thenAccept(S0059_FetchAsyncHttpClient::onFetch); } } diff --git a/S60_MagicalBeanEventHandler.java b/S0060_MagicalBeanEventHandler.java similarity index 74% rename from S60_MagicalBeanEventHandler.java rename to S0060_MagicalBeanEventHandler.java index c8f84d2..45e37e7 100644 --- a/S60_MagicalBeanEventHandler.java +++ b/S0060_MagicalBeanEventHandler.java @@ -1,14 +1,14 @@ import static java.lang.System.*; import java.beans.EventHandler; -public class S60_MagicalBeanEventHandler { +public class S0060_MagicalBeanEventHandler { public void notifyDuke() { out.println("run was called"); } public static void main(String... args) { - var app = new S60_MagicalBeanEventHandler(); + var app = new S0060_MagicalBeanEventHandler(); var runnable = EventHandler.create(Runnable.class, app,"notifyDuke"); runnable.run(); } diff --git a/S61_SwitchWithRecords.java b/S0061_SwitchWithRecords.java similarity index 100% rename from S61_SwitchWithRecords.java rename to S0061_SwitchWithRecords.java diff --git a/S62_DestructuringNestedRecords.java b/S0062_DestructuringNestedRecords.java similarity index 100% rename from S62_DestructuringNestedRecords.java rename to S0062_DestructuringNestedRecords.java diff --git a/S63_ShorterInterfaceFields.java b/S0063_ShorterInterfaceFields.java similarity index 100% rename from S63_ShorterInterfaceFields.java rename to S0063_ShorterInterfaceFields.java diff --git a/S64_UnmodifiableCopyOf.java b/S0064_UnmodifiableCopyOf.java similarity index 100% rename from S64_UnmodifiableCopyOf.java rename to S0064_UnmodifiableCopyOf.java diff --git a/S65_ClipboardWasher.java b/S0065_ClipboardWasher.java similarity index 100% rename from S65_ClipboardWasher.java rename to S0065_ClipboardWasher.java diff --git a/S66_ParseVsValueOf.java b/S0066_ParseVsValueOf.java similarity index 100% rename from S66_ParseVsValueOf.java rename to S0066_ParseVsValueOf.java diff --git a/S67_ListLastElement.java b/S0067_ListLastElement.java similarity index 100% rename from S67_ListLastElement.java rename to S0067_ListLastElement.java diff --git a/S68_Block.java b/S0068_Block.java similarity index 100% rename from S68_Block.java rename to S0068_Block.java diff --git a/S69_ListFilesInDirectory.java b/S0069_ListFilesInDirectory.java similarity index 100% rename from S69_ListFilesInDirectory.java rename to S0069_ListFilesInDirectory.java diff --git a/S70_LeadingZeroFormatting.java b/S0070_LeadingZeroFormatting.java similarity index 100% rename from S70_LeadingZeroFormatting.java rename to S0070_LeadingZeroFormatting.java diff --git a/S71_CloseIOStreams.java b/S0071_CloseIOStreams.java similarity index 100% rename from S71_CloseIOStreams.java rename to S0071_CloseIOStreams.java diff --git a/S72_FlatMapWithOptional.java b/S0072_FlatMapWithOptional.java similarity index 100% rename from S72_FlatMapWithOptional.java rename to S0072_FlatMapWithOptional.java diff --git a/S73_ListOfDifferentImpls.java b/S0073_ListOfDifferentImpls.java similarity index 100% rename from S73_ListOfDifferentImpls.java rename to S0073_ListOfDifferentImpls.java diff --git a/S74_WorkingDirectory.java b/S0074_WorkingDirectory.java similarity index 100% rename from S74_WorkingDirectory.java rename to S0074_WorkingDirectory.java diff --git a/S75_get-javahome.java b/S0075_get-javahome.java similarity index 100% rename from S75_get-javahome.java rename to S0075_get-javahome.java diff --git a/S76_ConsoleYesNo.java b/S0076_ConsoleYesNo.java similarity index 93% rename from S76_ConsoleYesNo.java rename to S0076_ConsoleYesNo.java index f25bc26..9a124bf 100644 --- a/S76_ConsoleYesNo.java +++ b/S0076_ConsoleYesNo.java @@ -1,6 +1,6 @@ import java.io.Console; -public class App { +interface App { static boolean yes() { return System.console() diff --git a/S77_CreateNestedFoldersWithFile.java b/S0077_CreateNestedFoldersWithFile.java similarity index 100% rename from S77_CreateNestedFoldersWithFile.java rename to S0077_CreateNestedFoldersWithFile.java diff --git a/S78_SystemLoggerConfiguration.java b/S0078_SystemLoggerConfiguration.java similarity index 100% rename from S78_SystemLoggerConfiguration.java rename to S0078_SystemLoggerConfiguration.java diff --git a/S79_AllEmojis.java b/S0079_AllEmojis.java similarity index 100% rename from S79_AllEmojis.java rename to S0079_AllEmojis.java diff --git a/S80_ProgrammaticallyGetClasspath.java b/S0080_ProgrammaticallyGetClasspath.java similarity index 100% rename from S80_ProgrammaticallyGetClasspath.java rename to S0080_ProgrammaticallyGetClasspath.java diff --git a/S81_IsLowerCase.java b/S0081_IsLowerCase.java similarity index 100% rename from S81_IsLowerCase.java rename to S0081_IsLowerCase.java diff --git a/S82_StringToNumberTransform.java b/S0082_StringToNumberTransform.java similarity index 100% rename from S82_StringToNumberTransform.java rename to S0082_StringToNumberTransform.java diff --git a/S83_PrintEmojisWithName.java b/S0083_PrintEmojisWithName.java similarity index 100% rename from S83_PrintEmojisWithName.java rename to S0083_PrintEmojisWithName.java diff --git a/S84_ReadingIntStreams.java b/S0084_ReadingIntStreams.java similarity index 100% rename from S84_ReadingIntStreams.java rename to S0084_ReadingIntStreams.java diff --git a/S85_Beep.java b/S0085_Beep.java similarity index 100% rename from S85_Beep.java rename to S0085_Beep.java diff --git a/S86_StringToCSV.java b/S0086_StringToCSV.java similarity index 100% rename from S86_StringToCSV.java rename to S0086_StringToCSV.java diff --git a/S87_DateFormatForFileNaming.java b/S0087_DateFormatForFileNaming.java similarity index 100% rename from S87_DateFormatForFileNaming.java rename to S0087_DateFormatForFileNaming.java diff --git a/S88_EnumAsLogger.java b/S0088_EnumAsLogger.java similarity index 100% rename from S88_EnumAsLogger.java rename to S0088_EnumAsLogger.java diff --git a/S89_FileCreationTime.java b/S0089_FileCreationTime.java similarity index 86% rename from S89_FileCreationTime.java rename to S0089_FileCreationTime.java index 4085b6f..7886f7f 100644 --- a/S89_FileCreationTime.java +++ b/S0089_FileCreationTime.java @@ -6,7 +6,7 @@ interface App { static void main(String... args) throws IOException { - var path = Paths.get("./S89_FileCreationTime.java"); + var path = Paths.get("./S0089_FileCreationTime.java"); var at = Files.readAttributes(path, BasicFileAttributes.class); var creationTime = at.creationTime(); System.out.println(creationTime); diff --git a/S90_EnvEntriesWithTransform.java b/S0090_EnvEntriesWithTransform.java similarity index 100% rename from S90_EnvEntriesWithTransform.java rename to S0090_EnvEntriesWithTransform.java diff --git a/S91_CodeBlocksSingleLine.java b/S0091_CodeBlocksSingleLine.java similarity index 100% rename from S91_CodeBlocksSingleLine.java rename to S0091_CodeBlocksSingleLine.java diff --git a/S92_BiFunctionVsBinaryOperator.java b/S0092_BiFunctionVsBinaryOperator.java similarity index 100% rename from S92_BiFunctionVsBinaryOperator.java rename to S0092_BiFunctionVsBinaryOperator.java diff --git a/S93_FlattenNestedList.java b/S0093_FlattenNestedList.java similarity index 100% rename from S93_FlattenNestedList.java rename to S0093_FlattenNestedList.java diff --git a/S94_FasterFilterWithParallelStream.java b/S0094_FasterFilterWithParallelStream.java similarity index 100% rename from S94_FasterFilterWithParallelStream.java rename to S0094_FasterFilterWithParallelStream.java diff --git a/S95_ForeachVsStream.java b/S0095_ForeachVsStream.java similarity index 100% rename from S95_ForeachVsStream.java rename to S0095_ForeachVsStream.java diff --git a/S96_IsAssignableVsInstanceOf.java b/S0096_IsAssignableVsInstanceOf.java similarity index 100% rename from S96_IsAssignableVsInstanceOf.java rename to S0096_IsAssignableVsInstanceOf.java diff --git a/S97_CustomBase64Classloader.java b/S0097_CustomBase64Classloader.java similarity index 100% rename from S97_CustomBase64Classloader.java rename to S0097_CustomBase64Classloader.java diff --git a/S98_CastMethod.java b/S0098_CastMethod.java similarity index 100% rename from S98_CastMethod.java rename to S0098_CastMethod.java diff --git a/S99_MinimalisticEnumLogger.java b/S0099_MinimalisticEnumLogger.java similarity index 100% rename from S99_MinimalisticEnumLogger.java rename to S0099_MinimalisticEnumLogger.java diff --git a/S100_AutoboxingCache.java b/S0100_AutoboxingCache.java similarity index 100% rename from S100_AutoboxingCache.java rename to S0100_AutoboxingCache.java diff --git a/S100_AutoboxingCacheSizeStartupTime.java b/S0100_AutoboxingCacheSizeStartupTime.java similarity index 100% rename from S100_AutoboxingCacheSizeStartupTime.java rename to S0100_AutoboxingCacheSizeStartupTime.java diff --git a/S100_BehavioralEnums.java b/S0100_BehavioralEnums.java similarity index 100% rename from S100_BehavioralEnums.java rename to S0100_BehavioralEnums.java diff --git a/S100_BrokenCleaners.java b/S0100_BrokenCleaners.java similarity index 100% rename from S100_BrokenCleaners.java rename to S0100_BrokenCleaners.java diff --git a/S100_Cleaners.java b/S0100_Cleaners.java similarity index 100% rename from S100_Cleaners.java rename to S0100_Cleaners.java diff --git a/S100_ClockTicks.java b/S0100_ClockTicks.java similarity index 100% rename from S100_ClockTicks.java rename to S0100_ClockTicks.java diff --git a/S100_CountdownLatch.java b/S0100_CountdownLatch.java similarity index 100% rename from S100_CountdownLatch.java rename to S0100_CountdownLatch.java diff --git a/S100_CountdownLatchLoop.java b/S0100_CountdownLatchLoop.java similarity index 100% rename from S100_CountdownLatchLoop.java rename to S0100_CountdownLatchLoop.java diff --git a/S100_CustomIterableForEach.java b/S0100_CustomIterableForEach.java similarity index 100% rename from S100_CustomIterableForEach.java rename to S0100_CustomIterableForEach.java diff --git a/S100_DetectOS.java b/S0100_DetectOS.java similarity index 100% rename from S100_DetectOS.java rename to S0100_DetectOS.java diff --git a/S100_EasyFiles.java b/S0100_EasyFiles.java similarity index 69% rename from S100_EasyFiles.java rename to S0100_EasyFiles.java index 559bad8..49beafd 100644 --- a/S100_EasyFiles.java +++ b/S0100_EasyFiles.java @@ -5,8 +5,8 @@ interface App { static void main(String... args) throws IOException { - var in = Path.of("./App.java"); - var out = Path.of("./AppUpper.java"); + var in = Path.of("./S0100_EasyFiles.java"); + var out = Path.of("./_S0100_EasyFiles_CopyTarget.java"); var content = Files.readString(in).toUpperCase(); Files.writeString(out,content); } diff --git a/S100_EasyISOInstant.java b/S0100_EasyISOInstant.java similarity index 100% rename from S100_EasyISOInstant.java rename to S0100_EasyISOInstant.java diff --git a/S100_EnumConstructors.java b/S0100_EnumConstructors.java similarity index 100% rename from S100_EnumConstructors.java rename to S0100_EnumConstructors.java diff --git a/S100_EnumDefaultConstructor.java b/S0100_EnumDefaultConstructor.java similarity index 100% rename from S100_EnumDefaultConstructor.java rename to S0100_EnumDefaultConstructor.java diff --git a/S100_EnumSetComplementOf.java b/S0100_EnumSetComplementOf.java similarity index 100% rename from S100_EnumSetComplementOf.java rename to S0100_EnumSetComplementOf.java diff --git a/S100_Finalizers.java b/S0100_Finalizers.java similarity index 100% rename from S100_Finalizers.java rename to S0100_Finalizers.java diff --git a/S100_InstantParse.java b/S0100_InstantParse.java similarity index 100% rename from S100_InstantParse.java rename to S0100_InstantParse.java diff --git a/S100_Java22ListFormat.java b/S0100_Java22ListFormat.java similarity index 100% rename from S100_Java22ListFormat.java rename to S0100_Java22ListFormat.java diff --git a/S100_ListOfArraysAsList.java b/S0100_ListOfArraysAsList.java similarity index 100% rename from S100_ListOfArraysAsList.java rename to S0100_ListOfArraysAsList.java diff --git a/S100_MainInEnum.java b/S0100_MainInEnum.java similarity index 100% rename from S100_MainInEnum.java rename to S0100_MainInEnum.java diff --git a/S100_MainMethodFirst.java b/S0100_MainMethodFirst.java similarity index 100% rename from S100_MainMethodFirst.java rename to S0100_MainMethodFirst.java diff --git a/S100_MaintainabilityWithNestedEnums.java b/S0100_MaintainabilityWithNestedEnums.java similarity index 100% rename from S100_MaintainabilityWithNestedEnums.java rename to S0100_MaintainabilityWithNestedEnums.java diff --git a/S100_NicerSleep.java b/S0100_NicerSleep.java similarity index 100% rename from S100_NicerSleep.java rename to S0100_NicerSleep.java diff --git a/S100_ParallelStreamForkJoinConfiguration.java b/S0100_ParallelStreamForkJoinConfiguration.java similarity index 100% rename from S100_ParallelStreamForkJoinConfiguration.java rename to S0100_ParallelStreamForkJoinConfiguration.java diff --git a/S100_ParsingWithScanner.java b/S0100_ParsingWithScanner.java similarity index 100% rename from S100_ParsingWithScanner.java rename to S0100_ParsingWithScanner.java diff --git a/S100_Preferences.java b/S0100_Preferences.java similarity index 92% rename from S100_Preferences.java rename to S0100_Preferences.java index b09a248..719a10f 100644 --- a/S100_Preferences.java +++ b/S0100_Preferences.java @@ -1,5 +1,5 @@ import java.util.prefs.Preferences; -public interface App { +interface App { static void main(String... args) throws Exception { var root = Preferences.userRoot(); var air = root.node("air"); diff --git a/S100_ReadClassVersion.java b/S0100_ReadClassVersion.java similarity index 100% rename from S100_ReadClassVersion.java rename to S0100_ReadClassVersion.java diff --git a/S100_clock.java b/S0100_clock.java similarity index 100% rename from S100_clock.java rename to S0100_clock.java diff --git a/S101_MapOfNotEnough.java b/S0101_MapOfNotEnough.java similarity index 100% rename from S101_MapOfNotEnough.java rename to S0101_MapOfNotEnough.java diff --git a/S102_OpenURIInBrowser.java b/S0102_OpenURIInBrowser.java similarity index 100% rename from S102_OpenURIInBrowser.java rename to S0102_OpenURIInBrowser.java diff --git a/S103_AnnotationSuperclass.java b/S0103_AnnotationSuperclass.java similarity index 100% rename from S103_AnnotationSuperclass.java rename to S0103_AnnotationSuperclass.java diff --git a/S104_HtmlList.java b/S0104_HtmlList.java similarity index 100% rename from S104_HtmlList.java rename to S0104_HtmlList.java diff --git a/S105_DaysToVacations.java b/S0105_DaysToVacations.java similarity index 100% rename from S105_DaysToVacations.java rename to S0105_DaysToVacations.java diff --git a/S106_ToInstantWithoutTZ.java b/S0106_ToInstantWithoutTZ.java similarity index 100% rename from S106_ToInstantWithoutTZ.java rename to S0106_ToInstantWithoutTZ.java diff --git a/S107_DaysToVacationsDatesUntil.java b/S0107_DaysToVacationsDatesUntil.java similarity index 100% rename from S107_DaysToVacationsDatesUntil.java rename to S0107_DaysToVacationsDatesUntil.java diff --git a/S108_WeekDaysEnum.java b/S0108_WeekDaysEnum.java similarity index 100% rename from S108_WeekDaysEnum.java rename to S0108_WeekDaysEnum.java diff --git a/S109_MonthDay.java b/S0109_MonthDay.java similarity index 100% rename from S109_MonthDay.java rename to S0109_MonthDay.java diff --git a/S110_FirstMondayOfTheMonth.java b/S0110_FirstMondayOfTheMonth.java similarity index 100% rename from S110_FirstMondayOfTheMonth.java rename to S0110_FirstMondayOfTheMonth.java diff --git a/S111_TemporalQuery.java b/S0111_TemporalQuery.java similarity index 100% rename from S111_TemporalQuery.java rename to S0111_TemporalQuery.java diff --git a/S112_ExceptionsAndAbstraction.java b/S0112_ExceptionsAndAbstraction.java similarity index 100% rename from S112_ExceptionsAndAbstraction.java rename to S0112_ExceptionsAndAbstraction.java diff --git a/S113_NullsInSwitchAndIf.java b/S0113_NullsInSwitchAndIf.java similarity index 100% rename from S113_NullsInSwitchAndIf.java rename to S0113_NullsInSwitchAndIf.java diff --git a/S114_EnumToMap.java b/S0114_EnumToMap.java similarity index 100% rename from S114_EnumToMap.java rename to S0114_EnumToMap.java diff --git a/S115_ArraysStreamVsStreamOf.java b/S0115_ArraysStreamVsStreamOf.java similarity index 100% rename from S115_ArraysStreamVsStreamOf.java rename to S0115_ArraysStreamVsStreamOf.java diff --git a/S116_StringJoinVsCollectorsJoining.java b/S0116_StringJoinVsCollectorsJoining.java similarity index 100% rename from S116_StringJoinVsCollectorsJoining.java rename to S0116_StringJoinVsCollectorsJoining.java diff --git a/S117_MemoryUsage.java b/S0117_MemoryUsage.java similarity index 100% rename from S117_MemoryUsage.java rename to S0117_MemoryUsage.java diff --git a/S118_SmallestJavaRAM.java b/S0118_SmallestJavaRAM.java similarity index 100% rename from S118_SmallestJavaRAM.java rename to S0118_SmallestJavaRAM.java diff --git a/S119_1000TimesSorry.java b/S0119_1000TimesSorry.java similarity index 100% rename from S119_1000TimesSorry.java rename to S0119_1000TimesSorry.java diff --git a/S120_DaysToDevoxxWithChronoUnit.java b/S0120_DaysToDevoxxWithChronoUnit.java similarity index 100% rename from S120_DaysToDevoxxWithChronoUnit.java rename to S0120_DaysToDevoxxWithChronoUnit.java diff --git a/S121_GlobPatternMatching.java b/S0121_GlobPatternMatching.java similarity index 90% rename from S121_GlobPatternMatching.java rename to S0121_GlobPatternMatching.java index 64d05a3..08db60a 100644 --- a/S121_GlobPatternMatching.java +++ b/S0121_GlobPatternMatching.java @@ -1,7 +1,7 @@ import java.nio.file.FileSystems; import java.nio.file.Path; -interface S121_GlobPatternMatching { +interface S0121_GlobPatternMatching { static void main(String... args) { var fs = FileSystems.getDefault(); diff --git a/S122_DateTimeFormatterBuilder.java b/S0122_DateTimeFormatterBuilder.java similarity index 95% rename from S122_DateTimeFormatterBuilder.java rename to S0122_DateTimeFormatterBuilder.java index 921c705..e589c28 100644 --- a/S122_DateTimeFormatterBuilder.java +++ b/S0122_DateTimeFormatterBuilder.java @@ -7,7 +7,7 @@ import java.time.LocalTime; -interface S122_DateTimeFormatterBuilder { +interface S0122_DateTimeFormatterBuilder { static void main(String... args) { var formatter = new DateTimeFormatterBuilder() diff --git a/S123_AllTimeZones.java b/S0123_AllTimeZones.java similarity index 100% rename from S123_AllTimeZones.java rename to S0123_AllTimeZones.java diff --git a/S124_StringConcatWithReduce.java b/S0124_StringConcatWithReduce.java similarity index 85% rename from S124_StringConcatWithReduce.java rename to S0124_StringConcatWithReduce.java index dbb3d1b..6648e5d 100644 --- a/S124_StringConcatWithReduce.java +++ b/S0124_StringConcatWithReduce.java @@ -1,7 +1,7 @@ import java.util.stream.Stream; import java.util.stream.Collectors; -interface S124_StringConcatWithReduce { +interface S0124_StringConcatWithReduce { static void main(String... args) { var result = Stream diff --git a/S125_ArrayOfLambdas.java b/S0125_ArrayOfLambdas.java similarity index 100% rename from S125_ArrayOfLambdas.java rename to S0125_ArrayOfLambdas.java diff --git a/S126_StreamConcatWithStringJoin.java b/S0126_StreamConcatWithStringJoin.java similarity index 83% rename from S126_StreamConcatWithStringJoin.java rename to S0126_StreamConcatWithStringJoin.java index 9c82268..6ae518b 100644 --- a/S126_StreamConcatWithStringJoin.java +++ b/S0126_StreamConcatWithStringJoin.java @@ -2,9 +2,7 @@ import java.util.List; import java.util.stream.Collectors; -interface S126_StreamConcatWithStringJoin { - - +interface S0126_StreamConcatWithStringJoin { static void main(String... args) { var result = List diff --git a/S127_ContentEqualsOverEquals.java b/S0127_ContentEqualsOverEquals.java similarity index 79% rename from S127_ContentEqualsOverEquals.java rename to S0127_ContentEqualsOverEquals.java index 966618a..024b179 100644 --- a/S127_ContentEqualsOverEquals.java +++ b/S0127_ContentEqualsOverEquals.java @@ -1,4 +1,4 @@ -interface S127_ContentEqualsOverEquals { +interface S0127_ContentEqualsOverEquals { static void main(String... args) { var first = "duke"; diff --git a/S128_AutoboxingCache.java b/S0128_AutoboxingCache.java similarity index 100% rename from S128_AutoboxingCache.java rename to S0128_AutoboxingCache.java diff --git a/S129_AutoboxingCacheSizeStartupTime.java b/S0129_AutoboxingCacheSizeStartupTime.java similarity index 100% rename from S129_AutoboxingCacheSizeStartupTime.java rename to S0129_AutoboxingCacheSizeStartupTime.java diff --git a/S130_StreamIterate.java b/S0130_StreamIterate.java similarity index 100% rename from S130_StreamIterate.java rename to S0130_StreamIterate.java diff --git a/S03_VarArgs.java b/S03_VarArgs.java deleted file mode 100644 index d4ee76e..0000000 --- a/S03_VarArgs.java +++ /dev/null @@ -1,14 +0,0 @@ -interface S03_VarArgs { - - static void hello(String... messages) { - for (var message : messages) { - System.out.println(message); - } - } - - static void main(String... args) { - S03_VarArgs.hello("hey", "duke", "java"); - S03_VarArgs.hello("is", "working"); - S03_VarArgs.hello(new String[] { "is", "always", "working" }); - } -} \ No newline at end of file diff --git a/S18_InitializersAndConstructors.java b/S18_InitializersAndConstructors.java deleted file mode 100644 index b7fb418..0000000 --- a/S18_InitializersAndConstructors.java +++ /dev/null @@ -1,20 +0,0 @@ -public class S18_InitializersAndConstructors { - - public S18_InitializersAndConstructors() { - System.out.println("parameterless"); - } - - public S18_InitializersAndConstructors(String name) { - System.out.println(name); - } - - { - System.out.println("shared code"); - } - - - public static void main(String[] args) { - new S18_InitializersAndConstructors(); - new S18_InitializersAndConstructors("with parameter"); - } -} \ No newline at end of file diff --git a/S58_ShortestMain.java b/S58_ShortestMain.java deleted file mode 100644 index 1f69aea..0000000 --- a/S58_ShortestMain.java +++ /dev/null @@ -1,3 +0,0 @@ -void main() { - System.out.println("hello, world"); -} \ No newline at end of file