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: github.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:3d353486-ca35-b693-a2a2-599f566542b1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B292:1C6D7B:406FE7:56C2CD:6977D800 |
| html-safe-nonce | c3cf17dc0f2491a223b9fb3214e86fd6a27dfd749ab828e3a8ee0f3f4093e10d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjkyOjFDNkQ3Qjo0MDZGRTc6NTZDMkNEOjY5NzdEODAwIiwidmlzaXRvcl9pZCI6IjgyNjExMjk0NTk3MDg5NzUxMDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e9ba7d09b6591703f0e17f534a714a0b5787e33603551ceaef5a332145bf7ef6 |
| 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 | b39e6c26c0326ac7510f4f58f7248053edc1a743c844376b8155c71ef8138521 |
| 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 | 9db2400e2405e5e571d97a25e1e140cfec8da1a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width