The Artima Developer Community
Sponsored Link

Java Answers Forum
why not public?

3 replies on 1 page. Most recent reply: Mar 23, 2005 6:26 AM by Matthias Neumair

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
park jung gyu

Posts: 4
Nickname: dalantpark
Registered: Mar, 2005

why not public? Posted: Mar 22, 2005 10:04 PM
Reply to this message Reply
Advertisement
package java.net;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.InterruptedIOException;
import java.io.FileDescriptor;
import java.io.ByteArrayOutputStream;

import sun.net.ConnectionResetException;

/**
* Default Socket Implementation. This implementation does
* not implement any security checks.
* Note this class should <b>NOT</b> be public.
*
* @author Steven B. Byrne
* @version 1.65, 12/19/03
*/
class PlainSocketImpl extends SocketImpl

...

* Note this class should <b>NOT</b> be public.

Why class above isn't public?

I want the reason.


Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: why not public? Posted: Mar 22, 2005 10:53 PM
Reply to this message Reply
All classes are "protected" by default, meaning they are visible to all other classes in the same package, but not to classes outside their package.

Amol Brid

Posts: 43
Nickname: amolbrid
Registered: Feb, 2004

Re: why not public? Posted: Mar 23, 2005 4:54 AM
Reply to this message Reply
The designers might want to hide the implementation from the developers.

Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: why not public? Posted: Mar 23, 2005 6:26 AM
Reply to this message Reply
Again, I did not read carefully.
Sorry

Flat View: This topic has 3 replies on 1 page
Topic: Exporting to DBF Previous Topic   Next Topic Topic: PLEASE HELP FAST

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use