{"id":15297268,"url":"https://github.com/seanmisra/java-coding-exercises","last_synced_at":"2025-03-25T13:14:52.804Z","repository":{"id":154157346,"uuid":"631701074","full_name":"seanmisra/java-coding-exercises","owner":"seanmisra","description":"40 Java Exercises","archived":false,"fork":false,"pushed_at":"2023-04-26T22:47:37.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-30T12:14:24.406Z","etag":null,"topics":["java","java-11","java-17","java-8"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seanmisra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-23T20:53:03.000Z","updated_at":"2023-04-26T22:48:11.000Z","dependencies_parsed_at":"2023-07-05T00:57:16.210Z","dependency_job_id":null,"html_url":"https://github.com/seanmisra/java-coding-exercises","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanmisra%2Fjava-coding-exercises","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanmisra%2Fjava-coding-exercises/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanmisra%2Fjava-coding-exercises/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanmisra%2Fjava-coding-exercises/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seanmisra","download_url":"https://codeload.github.com/seanmisra/java-coding-exercises/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245467614,"owners_count":20620216,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","java-11","java-17","java-8"],"created_at":"2024-09-30T19:16:09.353Z","updated_at":"2025-03-25T13:14:52.774Z","avatar_url":"https://github.com/seanmisra.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# java-coding-exercises\n\nCommits correspond to each exercise\n\n1. Maven project Hello World\n2. write main() entry-point function in another way\n3. Demonstrate String immutability\n4. Importance of order in String concatenation\n5. Widening and Narrowing (casting) examples\n6. How many primitive data types can equal 'a'?\n7. Demonstrate StringBuilder mutability (in contrast to String)\n8. String literal pool (use == to demonstrate equality)\n9. String equality with equals (use same examples from Exercise 8 for clarity)\n10. Default values (local vs instance)\n11. 3-5 ways to initialize an array\n12. 4 ways to initialize wrapper class (ex: Integer)\n13. Static/Instance initializer blocks (demonstrate calling order relative to constructor)\n14. Type Promotion (show one operator where it is used and one where it is not)\n15. x++ vs ++x\n16. Short-circuit vs Logical operator (ex: || vs |)\n17. Example where finally clause is not executed\n18. Create an infinite loop with for\n19. Examples of unary, binary, ternary operators\n20. Constructors -- demonstrate multiple constructors including usage of this()\n21. Constructors -- demonstrate usage of super()\n22. Multiple Inheritance (superclass vs interface)\n23. 4 kinds of interface methods (abstract, default, static, and private)\n24. 4 kinds of abstract class methods (abstract, non-abstract, static, and private)\n25. Convert array to List 2 ways (as List view and as new unique List)\n26. Use streams to sum integers 1-100 inclusive (ideally 2-3 different ways)\n27. Sort an ArrayList based on two properties (1st/2nd precedent)\n28. Generate 1000 random numbers btw 1 and 5, and return a Map with the results\n29. Streams - examples of using map and flatmap\n30. Get today's date in YYYY-MM-DD format\n31. Get today's date in YYYY-MM-DD format with timezone offset\n32. 2 ways to create a Thread (extend Thread/implement Runnable)\n33. Read a file line by line with BufferedReader\n34. Read all lines from file with Files utility class\n35. Use BufferedWriter to write to a file\n36. Write/read object to file via serialization/deserialization (include one static and one transient field)\n37. Example class that uses generics\n38. Synchronized function (counter example; test with ExecutorService)\n39. Repeat exercise 38 with a synchronized lock\n40. JDBC (code flow for calling a PreparedStatement and reading from ResultSet)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseanmisra%2Fjava-coding-exercises","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseanmisra%2Fjava-coding-exercises","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseanmisra%2Fjava-coding-exercises/lists"}