Skip to content

Commit 61252b5

Browse files
bowbahdoefirasrg
andauthored
Update main (#48)
* more sections * First feedback round * Update prelude.md * ... * Spelling fix Co-Authored-By: Firas Regaieg <[email protected]> * Arguments chapter * More Challenges * Run prettier * user input * October 14th, #1 * Array challenges * Delete challenges * Null * ... * Update null_as_absence.md * Delete out.json * Fix quotes * Add first no_runs * Fix number example * ... * Write more of the classes section * Constructors * Clean up getting started a little * Use a duke * Don't link anywhere yet * Increase lines needed to show a duke * Fix field access section * ... * ... * ... * ... * ... * switch and enums * Update book.toml * Density * Update audience.md * .. * Strings 2 * Update length.md * Global Fields * Input * Update delayed_assignment.md * ... * ... * Update book.js * Update challenges.md * Remove blank Challenge * Fix some issues, push some incomplete sections * Update challenges.md * terminal * Update challenges.md * Switches and visibility * Growable array * Cli Args * Delete unused * Change url * inner classes * Update unchecked_exceptions.md * Update checked_exceptions.md * Update invariants.md * Packages * Records * Update the_default_package.md * Syntax highlighting wierdness * More records * Integers, Files, etc. * Move IOException around * ... * ... --------- Co-authored-by: Firas Regaieg <[email protected]>
1 parent 95b8379 commit 61252b5

File tree

185 files changed

+4460
-54
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+4460
-54
lines changed

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Modern Java
22

33
[![codefactor](https://img.shields.io/codefactor/grade/github/together-java/modernjava)](https://www.codefactor.io/repository/github/together-java/modernjava)
4-
![Java](https://img.shields.io/badge/Java-19-ff696c)
54
[![license](https://img.shields.io/github/license/Together-Java/ModernJava)](https://github.com/Together-Java/ModernJava/blob/master/LICENSE)
65

76
Book teaching how to write modern and effective Java. It is maintained by the community, anyone can contribute.

book.toml

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[book]
22
title = "Modern Java"
3-
description = " Book teaching how to write modern and effective Java. It is maintained by the community, anyone can contribute."
4-
authors = ["Together Java", "Contributions from the Java Community"]
3+
description = "Book teaching how to write modern and effective Java."
4+
authors = ["Ethan McCue", "Together Java", "Contributions from the Java Community"]
55
language = "en"
66
multilingual = false
77

@@ -21,5 +21,3 @@ editable = true
2121

2222
[output.html.code.hidelines]
2323
java = "~"
24-
[output.html.code.hidelines]
25-
java = "~"

ferris.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,12 @@ function createFerris(type, size) {
5353
// a.setAttribute('href', 'ch00-00-introduction.html#ferris')
5454
a.setAttribute('target', '_blank')
5555

56+
var toFileName = function (t) {
57+
return '../img/' + t.attr + '.svg';
58+
}
59+
5660
var img = document.createElement('img')
57-
img.setAttribute('src', '../img/' + type.attr + '.svg')
61+
img.setAttribute('src', toFileName(type))
5862
img.setAttribute('title', type.title)
5963
img.classList.add('ferris')
6064
img.classList.add('ferris-' + size)

src/SUMMARY.md

+295-18
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,9 @@
9999
- [If](./branching_logic/if.md)
100100
- [Nested Ifs](./branching_logic/nested_ifs.md)
101101
- [Else](./branching_logic/else.md)
102-
- [Else](./branching_logic/else.md)
103102
- [Else If](./branching_logic/else_if.md)
104103
- [Relation to Delayed Assignment](./branching_logic/relation_to_delayed_assignment.md)
105104
- [Scoped Variables](./branching_logic/scoped_variables.md)
106-
- [Scoped Variables](./branching_logic/scoped_variables.md)
107105
- [Conditional Operator](./branching_logic/conditional_operator.md)
108106
- [Boolean Expressions](./branching_logic/boolean_expressions.md)
109107
- [Challenges](./branching_logic/challenges.md)
@@ -209,7 +207,6 @@
209207
- [Boxing Conversion](./boxed_primitives/boxing_conversion.md)
210208
- [Arrays of Boxed Primitives](./boxed_primitives/arrays_of_boxed_primitives.md)
211209
- [Challenges](./boxed_primitives/challenges.md)
212-
- [Challenges](./boxed_primitives/challenges.md)
213210
- [Arrays II](./arrays_ii.md)
214211
- [Initializion with Size](./arrays_ii/initialization_with_size.md)
215212
- [Default Values](./arrays_ii/default_values.md)
@@ -249,6 +246,13 @@
249246
- [Usage](./enums/usage.md)
250247
- [Equality](./enums/equality.md)
251248
- [Comparison to boolean](./enums/comparison_to_boolean.md)
249+
- [Strings II](./strings_ii.md)
250+
- [lowercase](./strings_ii/lowercase.md)
251+
- [UPPERCASE](./strings_ii/UPPERCASE.md)
252+
- [Equality ignoring case](./strings_ii/equality_ignoring_case.md)
253+
- [Check if empty](./strings_ii/check_if_empty.md)
254+
- [Check if blank](./strings_ii/check_if_blank.md)
255+
- [Strip extra whitespace](./strings_ii/strip_extra_whitespace.md)
252256

253257
# Control Flow III
254258

@@ -277,28 +281,302 @@
277281
- [Invariants](./constructors/invariants.md)
278282
- [Overloads](./constructors/overloads.md)
279283
- [Delegation](./constructors/delegation.md)
284+
- [Global Fields](./global_fields.md)
285+
- [Default Values](./global_fields/default_values.md)
286+
- [Final Fields](./global_fields/final_fields.md)
287+
- [Field Access](./global_fields/field_access.md)
288+
- [Inferred Types](./global_fields/inferred_types.md)
289+
290+
# Concepts
291+
292+
- [Code is Read more than Written](./code_is_read_more_than_written.md)
293+
- [Meaning](./code_is_read_more_than_written/meaning.md)
294+
- [Implications](./code_is_read_more_than_written/implications.md)
295+
- [Information Density](./code_is_read_more_than_written/information_density.md)
296+
- [Audience](./code_is_read_more_than_written/audience.md)
297+
- [Practice](./code_is_read_more_than_written/practice.md)
298+
299+
# Interactive Programs
300+
301+
- [Standard Input](./standard_input.md)
302+
- [Prompting](./standard_input/prompting.md)
303+
- [Interpreting Input](./standard_input/interpreting_input.md)
304+
- [Reprompting](./standard_input/reprompting.md)
305+
- [Leniency](./standard_input/leniency.md)
306+
- [Delayed Assignment](./standard_input/delayed_assignment.md)
307+
- [Transporting Data](./standard_input/transporting_data.md)
308+
309+
# The Computing Environment
310+
311+
- [Hardware](./hardware.md)
312+
- [CPU](./hardware/cpu.md)
313+
- [RAM](./hardware/ram.md)
314+
- [Hard Drives](./hardware/hard_drives.md)
315+
- [Motherboard](./hardware/motherboard.md)
316+
- [Operating Systems](./operating_systems.md)
317+
- [Personal Computers](./operating_systems/personal_computers.md)
318+
- [Servers](./operating_systems/servers.md)
319+
- [Mobile Phones](./operating_systems/mobile_phones.md)
320+
- [Game Consoles](./operating_systems/game_consoles.md)
321+
- [Abstractions](./operating_systems/abstractions.md)
322+
- [Defaults](./operating_systems/defaults.md)
323+
- [The Terminal](./the_terminal.md)
324+
- [Bash](./the_terminal/bash.md)
325+
- [Windows Subsystem for Linux](./the_terminal/windows_subsystem_for_linux.md)
326+
- [Chromebooks and School Computers](./the_terminal/chromebooks_and_school_computers.md)
327+
- [Commands](./the_terminal/commands.md)
328+
- [Directories](./the_terminal/directories.md)
329+
- [Listing Files](./the_terminal/listing_files.md)
330+
- [Creating Directories](./the_terminal/creating_directories.md)
331+
- [Changing Directories](./the_terminal/changing_directories.md)
332+
- [Creating Files](./the_terminal/creating_files.md)
333+
- [Run Java Programs](./the_terminal/run_java_programs.md)
334+
- [Getting Used to it](./the_terminal/getting_used_to_it.md)
280335

281336

337+
# Control Flow III
282338

283-
<!--
339+
- [Exceptions II](./exceptions_ii.md)
340+
- [Checked Exceptions](./exceptions_ii/checked_exceptions.md)
341+
- [Unchecked Exceptions](./exceptions_ii/unchecked_exceptions.md)
342+
- [throws](./exceptions_ii/throws.md)
343+
- [Propagating Exceptions](./exceptions_ii/propagating_exceptions.md)
344+
- [Rethrowing Exceptions](./exceptions_ii/rethrowing_exceptions.md)
345+
- [Exception](./exceptions_ii/exception.md)
346+
- [RuntimeException](./exceptions_ii/runtime_exception.md)
347+
- [main](./exceptions_ii/main.md)
348+
- [Switch II](./switch_ii.md)
349+
- [Yield](./switch_ii/yield.md)
350+
- [Omitted Yield](./switch_ii/omitted_yield.md)
351+
- [Exhaustiveness](./switch_ii/exhaustiveness.md)
352+
- [Return a Switch](./switch_ii/return_a_switch.md)
353+
354+
# Code Structure IV
355+
356+
- [Multi-File Programs](./multi_file_programs.md)
357+
- [The Sources folder](./multi_file_programs/the_sources_folder.md)
358+
- [The Main file](./multi_file_programs/the_main_file.md)
359+
- [A Second file](./multi_file_programs/a_second_file.md)
360+
- [File names](./multi_file_programs/file_names.md)
361+
- [The Anonymous Main Class](./multi_file_programs/the_anonymous_main_class.md)
362+
- [Global Fields](./multi_file_programs/global_fields.md)
363+
- [Visibility](./visibility.md)
364+
- [Private Methods](./visibility/private_methods.md)
365+
- [Private Fields](./visibility/private_fields.md)
366+
- [Invariants](./visibility/invariants.md)
367+
- [Accessors](./visibility/accessors.md)
368+
- [Getters and Setters](./visibility/getter_and_setters.md)
369+
- [Static Fields](./static_fields.md)
370+
- [Declaration](./static_fields/declaration.md)
371+
- [Initialization](./static_fields/initialization.md)
372+
- [Usage](./static_fields/usage.md)
373+
- [Constants](./static_fields/constants.md)
374+
- [Controversy](./static_fields/controversy.md)
375+
- [Naming](./static_fields/naming.md)
376+
- [Static Methods](./static_methods.md)
377+
- [Declaration](./static_methods/declaration.md)
378+
- [Scope](./static_methods/scope.md)
379+
- [Naming](./static_methods/naming.md)
380+
- [Usage](./static_methods/usage.md)
381+
- [Math](./static_methods/math.md)
382+
- [Factories](./static_methods/factories.md)
383+
384+
# Data Structures & Algorithms
385+
386+
- [Growable Arrays](./growable_arrays.md)
387+
- [Concept](./growable_arrays/concept.md)
388+
- [Simple Implementation](./growable_arrays/simple_implementation.md)
389+
- [Usage](./growable_arrays/usage.md)
390+
- [Performance Problems](./growable_arrays/performance_problems.md)
391+
- [Performance Solutions](./growable_arrays/performance_solutions.md)
392+
- [Optimized Implementation](./growable_arrays/optimized_implementation.md)
393+
394+
# Interactive Programs II
395+
396+
- [Command Line Arguments](./command_line_arguments.md)
397+
- [Accessing Arguments](./command_line_arguments/accessing_arguments.md)
398+
- [Conventions](./command_line_arguments/conventions.md)
399+
400+
401+
# Code Structure IV
402+
403+
- [Inner Classes](./inner_classes.md)
404+
- [Type](./inner_classes/type.md)
405+
- [Instances](./inner_classes/instances.md)
406+
- [New Operator](./inner_classes/new_operator.md)
407+
- [Scope](./inner_classes/scope.md)
408+
- [Disambiguation](./inner_classes/disambiguation.md)
409+
- [The anonymous main class](./inner_classes/the_anonymous_main_class.md)
410+
- [Static Inner Classes](./inner_classes/static_inner_classes.md)
411+
- [Private Inner Classes](./inner_classes/private_inner_classes.md)
412+
- [Packages](./packages.md)
413+
- [Declaration](./packages/declaration.md)
414+
- [Visibility](./packages/visibility.md)
415+
- [Public Classes](./packages/public_classes.md)
416+
- [Fully Qualified Class Name](./packages/fully_qualified_class_name.md)
417+
- [Import](./packages/import.md)
418+
- [The Default Package](./packages/the_default_package.md)
419+
- [The Anonymous Main Class](./packages/the_anonymous_main_class.md)
420+
- [Public Methods](./packages/public_methods.md)
421+
- [Package-Private Methods](./packages/package_private_methods.md)
422+
- [Public Fields](./packages/public_fields.md)
423+
- [Package-Private Fields](./packages/package_private_fields.md)
424+
- [The Default Constructor](./packages/the_default_constructor.md)
425+
- [Public Constructors](./packages/public_constructors.md)
426+
- [Package-Private Constructors](./packages/package_private_constructors.md)
427+
- [Subpackages](./packages/subpackages.md)
428+
- [Reverse Domain Name Notation](./packages/reverse_domain_name_notation.md)
284429

285-
- [Strings II](./strings_ii.md)
286-
- [length]()
430+
# Data Types IV
431+
432+
- [Records](./records.md)
433+
- [Declaration](./records/declaration.md)
434+
- [The Canonical Constructor](./records/the_canonical_constructor.md)
435+
- [Component Accessors](./records/component_accessors.md)
436+
- [Component Accessor Visibility](./records/component_accessor_visibility.md)
437+
- [Printing a Record](./records/printing_a_record.md)
438+
- [Check for Equality](./records/check_for_equality.md)
439+
- [Return Multiple Values](./records/return_multiple_values.md)
440+
- [Shorthand](./records/shorthand.md)
441+
442+
- [Integers II](./integers_ii.md)
443+
- [Integer from a String](./integers_ii/integer_from_a_string.md)
444+
- [Integer to a String](./integers_ii/integer_to_a_string.md)
445+
- [Base 16 Integer Literals](./integers_ii/base_16_integer_literals.md)
446+
- [Integer from a Base 16 String](./integers_ii/integer_from_a_base_16_string.md)
447+
- [Integer to a Base 16 String](./integers_ii/integer_to_a_base_16_string.md)
448+
- [Underscores in Integer Literals](./integers_ii/underscores_in_integer_literals.md)
449+
450+
# Interactive Programs III
451+
452+
- [Files](./files.md)
453+
- [Paths](./files/paths.md)
454+
- [IOException](./files/ioexception.md)
455+
- [UncheckedIOException](./files/uncheckedioexception.md)
456+
- [Write to a File](./files/write_to_a_file.md)
457+
- [Read from a File](./files/read_from_a_file.md)
458+
- [Create a Folder](./files/creating_a_folder.md)
459+
- [Delete a Folder](./files/creating_a_folder.md)
460+
- [Delete a File](./files/creating_a_folder.md)
461+
462+
# Data Structures & Algorithms II
463+
464+
- [Hash Maps]()
465+
- [Hash Sets]()
466+
467+
# Code Structure IV
468+
469+
470+
- [Interfaces]()
471+
- [@Override]()
472+
- [Generics]()
473+
- [Casting]()
474+
- [Object]()
475+
- [instanceof]()
476+
- [toString]()
287477
- [equals]()
288-
- [charAt]()
289-
- [equalsIgnoreCase]()
478+
- [hashCode]()
479+
480+
481+
<!--
482+
483+
484+
485+
# Data Types IV
486+
487+
- [StringBuilder](./string_builder.md)
488+
- [Pattern]()
489+
490+
491+
# Concepts
492+
493+
- [The Idiot Game](./the_idiot_game.md)
494+
495+
# Interactive Programs
496+
497+
498+
# The Computing Environment
499+
500+
501+
502+
503+
504+
# Interactive Programs
505+
506+
507+
- [Command Line Arguments]()
508+
509+
# Code Structure IV
510+
511+
512+
- [Import]()
513+
- [Packages]()
514+
- [Public]()
515+
- [Package Private]()
290516
291-
- [Multiple Source Files]()
292-
- [Why]()
293-
- [How]()
294-
- [Restrictions]()
295-
- [The Main Class]()
296-
- [The Implicit Main Class]()
297517
518+
# Data Types V
519+
520+
- [Strings III]()
521+
- [StringBuilder](./stringbuilder.md)
522+
- [Regular Expressions]()
523+
524+
# Code Structure V
525+
526+
- [toString]()
527+
- [Interfaces]()
528+
- [@Override]()
529+
530+
531+
# Code Structure V
532+
533+
- [Generics]()
534+
- [Declaration]()
535+
- [Safety]()
536+
- [Unsafe Casts]()
537+
538+
# Data Types VI
539+
540+
- [Integers II]()
541+
- [Paths]()
542+
- [Iterator and Iterable]()
543+
- [Exceptions II]()
544+
- [Lists]()
545+
- [ArrayList]()
546+
- [Add an item]()
547+
- [Get an item]()
548+
- [Set an item]()
549+
- [Loop over Contents]()
550+
551+
# Control Flow IV
298552
299-
- [Multiple Files]()
300-
- [The Implicit Main Class]()
301-
- [Private]()
553+
- [Loops III](./loops_iii.md)
554+
- [For Each]()
555+
556+
# Algorithms II
557+
558+
- [Hash Map]()
559+
560+
# Data Types VII
561+
562+
- [Maps]()
563+
- [HashMap]()
564+
- [Sets]()
565+
- [HashSet]()
566+
567+
# Interactive Programs II
568+
569+
- [Files]()
570+
571+
# Metaprogramming
572+
573+
- [Reflection]()
574+
- [Annotations]() -->
575+
576+
577+
<!--
578+
579+
302580
303581
## Data Types IV
304582
@@ -308,7 +586,6 @@
308586
- [Documentation Comments]()
309587
- [Testing]()
310588
311-
- [Example: "Growable" Array]()
312589
313590
# User Defined Types
314591

0 commit comments

Comments
 (0)