Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3633364
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:38:37+00:00 2026-05-19T00:38:37+00:00

Does System.out.println violate the law of demeter? If not, why?

  • 0

Does System.out.println violate the law of demeter?

If not, why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T00:38:37+00:00Added an answer on May 19, 2026 at 12:38 am

    Depending on view.

    LoD: Yes, because it uses the console. Under LoD you can’t assume access.

    LoD-F: Yes, because it uses more than one dot. The LoD-F states that in any method usage only the object may know the internal structure of itself.
    IE

    System.out.println() 
    

    requires knowledge of the structure of system (that it has .out) to reach println(),

    For System to not break LoD-F it would have to be

    System.println()
    

    To break the formal rules down with example, println() (the method) may only access:

    1. system itself
    2. println()’s parameters
    3. any objects created/instantiated within println()
    4. system’s direct component objects
    5. a global variable, accessible by system, in the scope of println()

    (I know, it’s a reversed reference here as the code should be the method calling it, but it actually swings both ways.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Where does tomcat put the System.out.println output ? I'm not interested in out.println .
Why does the following not work: String test = hello\world.replaceAll(\, \\\); System.out.println(test); What I'm
Why does this compile in java 6 (Sun 1.6.0_16): System.out.println(\u000B); ... but not this:
Why does System.out.println(-1<<32) display -1 in Java? Is there any root cause? I hope
This prints 83 System.out.println(0123) However this prints 123 System.out.println(123) Why does it work that
Why does .* and .+ give different results? System.out.println(foo.replaceAll(.+, bar)); // --> bar System.out.println(foo.replaceAll(.*,
Why does this int x = 2; for (int y =2; y>0;y--){ System.out.println(x +
Why does: System.out.println((3 + 7 + 10) * (1000 - 8) / (992 -
How is it that System.out.println(052) and System.out.println(0x2a) both print 42? Does this have to
This loop will continue indefinitely: char a = 100; for(a=100; a>=0;--a) System.out.println(a); Does it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.