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 3954230
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:04:19+00:00 2026-05-20T02:04:19+00:00

If System.out and System.in are made final so that we do not change them,

  • 0

If System.out and System.in are made final so that we do not change them, then why do we have the methods System.setIn and System.setOut? Isn’t the following statement contradictory?

System.in and System.out are
accessible directly without accessor
methods. But they are not directly
redirectable to other streams because
they are final. But we do have setter
methods to set them to some other
streams.

If they are final why even let them be reset? Or if we need them to be able to reset to some other streams why have them final in first place? Instead of directly accessing them why not let users write System.getIn() and System.getOut()?

  • 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-20T02:04:20+00:00Added an answer on May 20, 2026 at 2:04 am

    You’re basically looking at design warts left over from the very early days of Java. The fields existed in Java 1.0 (presumably already public and final), and when the designers realized that they needed a way to redirect them it was too late to change because that would have broken pretty much every single Java program in existence.

    Java’s design has always valued downwards compatibility above all else, so in Java 1.1 they added the set methods as workaround instead (making the fields non-final would just have made the design flaw worse, at least this way the set methods can e.g. do a permissions check).

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

Sidebar

Related Questions

Here's an example: Double d = (1/3); System.out.println(d); This returns 0, not 0.33333... as
We are sending out Word documents via email (automated system, not by hand). The
We need to get data out of an older accounting system. We have received
I have one table with composite key attribute.. For that i have made 2
The following code should be pretty self-evident. What I have made up so far
Does anyone know of an application or system out there for tracking changes (files
Object o = new Long[0] System.out.println( o.getClass().isArray() ) System.out.println( o.getClass().getName() ) Class ofArray =
Many times I saw logging of errors like these: System.out.println(Method aMethod with parameters a:+a+
When writing the string ¿ out using System.out.println(new String(¿.getBytes(UTF-8))); ¿ is written instead of
public class WrapperTest { static { print(10); } static void print(int x) { System.out.println(x);

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.