Title: Removal of redundant content for interface members · Issue #170 · java/devjava-content · GitHub
Open Graph Title: Removal of redundant content for interface members · Issue #170 · java/devjava-content
X Title: Removal of redundant content for interface members · Issue #170 · java/devjava-content
Description: Part 1: Since we know all the unimplemented interface methods are public and abstract by default. Could we please update the below method definition in below interface web page: Current interface definition: public interface AbstractZone...
Open Graph Description: Part 1: Since we know all the unimplemented interface methods are public and abstract by default. Could we please update the below method definition in below interface web page: Current interface d...
X Description: Part 1: Since we know all the unimplemented interface methods are public and abstract by default. Could we please update the below method definition in below interface web page: Current interface d...
Opengraph URL: https://github.com/java/devjava-content/issues/170
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Removal of redundant content for interface members","articleBody":"### Part 1:\n\nSince we know all the unimplemented interface methods are public and abstract by default. Could we please update the below method definition in below [interface](https://dev.java/learn/interfaces/examples/#extending-with-default-methods) web page:\n\n**Current interface definition:**\n\n`public interface AbstractZoneTimeClient extends TimeClient {\n public ZonedDateTime getZonedDateTime(String zoneString);\n}\n`\n**Updated interface definition:**\n\n`public interface AbstractZoneTimeClient extends TimeClient {\n ZonedDateTime getZonedDateTime(String zoneString);\n}\n`\n### Part 2:\n\nAs mentioned in [oracle docs](https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html#:~:text=All%20method%20declarations%20in%20an,can%20omit%20the%20public%20modifier.), all method declarations in an interface, including default methods, are implicitly public, so you can omit the public modifier. Could we remove the _public_ from below interface definition default method:\n\n**Current interface definition:**\n\n`public interface HandleInvalidTimeZoneClient extends TimeClient {\n default public ZonedDateTime getZonedDateTime(String zoneString) {\n try {\n return ZonedDateTime.of(getLocalDateTime(),ZoneId.of(zoneString)); \n } catch (DateTimeException e) {\n System.err.println(\"Invalid zone ID: \" + zoneString +\n \"; using the default time zone instead.\");\n return ZonedDateTime.of(getLocalDateTime(),ZoneId.systemDefault());\n }\n }\n}\n`\n**Updated interface definition:**\n\n`public interface HandleInvalidTimeZoneClient extends TimeClient {\n default ZonedDateTime getZonedDateTime(String zoneString) {\n try {\n return ZonedDateTime.of(getLocalDateTime(),ZoneId.of(zoneString)); \n } catch (DateTimeException e) {\n System.err.println(\"Invalid zone ID: \" + zoneString +\n \"; using the default time zone instead.\");\n return ZonedDateTime.of(getLocalDateTime(),ZoneId.systemDefault());\n }\n }\n}\n`\n","author":{"url":"https://github.com/satyamgupta11692","@type":"Person","name":"satyamgupta11692"},"datePublished":"2025-06-28T07:33:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/170/devjava-content/issues/170"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0ada2de4-2585-744a-2f05-6196f337d1f2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CF04:14F335:DE300A5:1209EC67:697703B4 |
| html-safe-nonce | 0999cacce4d8ab1db4a9c85917875dbc6f51cdd464fff78be2f91f85dcec6d2b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjA0OjE0RjMzNTpERTMwMEE1OjEyMDlFQzY3OjY5NzcwM0I0IiwidmlzaXRvcl9pZCI6IjgzNzEyMzM4OTI2ODk0NDU4MTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9f6b30e685482f9b978d15f793d6f3aac443b1f0de7fcf0bb9138728cf08db76 |
| hovercard-subject-tag | issue:3184692288 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/java/devjava-content/170/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5693e947ad9feefd84d6e6ee3e4f52f0b2cbe51fc9c6f2131b09800cc5cf07dd/java/devjava-content/issues/170 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5693e947ad9feefd84d6e6ee3e4f52f0b2cbe51fc9c6f2131b09800cc5cf07dd/java/devjava-content/issues/170 |
| og:image:alt | Part 1: Since we know all the unimplemented interface methods are public and abstract by default. Could we please update the below method definition in below interface web page: Current interface d... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | satyamgupta11692 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 01d198479908d09a841b2febe8eb105a81af2af7d81830960fe0971e1f4adc09 |
| turbo-cache-control | no-preview |
| go-import | github.com/java/devjava-content git https://github.com/java/devjava-content.git |
| octolytics-dimension-user_id | 126123820 |
| octolytics-dimension-user_login | java |
| octolytics-dimension-repository_id | 614090520 |
| octolytics-dimension-repository_nwo | java/devjava-content |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 614090520 |
| octolytics-dimension-repository_network_root_nwo | java/devjava-content |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f752335dbbea672610081196a1998e39aec5e14b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width