What is the difference between Public and Protected in Java? According to the Oracle documentation available here , Public is also available to the World while Protected is not. Now, I cannot understand what 'World' means here. Can anybody clarify, please? Thanks, Alberto
414
In Java, are there clear rules on when to use each of access modifiers, namely the default (package private), public, protected and private, while making class and interface and dealing with inheritance?
21605
If the question is locked, obviously new users can't post answers to it because no one can post answers. It seems somewhat redundant to list that box there. I'm not saying remove the protection from the question just because it's locked. After all, a question can be unlocked (although unlikely). However, it is unlikely and it's just an extra box there that doesn't really mean anything on the post anymore.  Most notably for the "protected" box, it states:     To answer it, you must have earned at least 10 reputation on this site.   Yet, because it's locked, that statement is untrue.    The "protected" box should be hidden when it is not possible to add additional answers to the question in the first place, which includes when the question is locked or closed. If the question is unlocked or reopened, it should be shown again.
34848
I used to use the implicit call of toString when wanting some debug info about an object, because in case of the object is null it does not throw an Exception.  For instance:    System.out.println("obj: "+obj);   instead of:  System.out.println("obj: "+obj.toString());   Is there any difference apart from the null case? Can the latter case work, when the former does not?  Edit: What exactly is done, in case of the implicit call?
29396
I'm wondering whether there is a difference between these two expressions. I never know which one to use. Google seems to return the same amount of results for both, so I suppose there might be a difference.        What are the alternatives for this project?     What are the alternatives to this project?
18958
How do I lock compiled Java classes to prevent decompilation?  I know this must be very well discussed topic on the Internet, but I could not come to any conclusion after referring them.  Many people do suggest obfuscator, but they just do renaming of classes, methods, and fields with tough-to-remember character sequences but what about sensitive constant values?  For example, you have developed the encryption and decryption component based on a password based encryption technique. Now in this case, any average Java person can use  to decompile the class file and easily retrieve the password value (defined as constant) as well as  and in turn can decrypt the data by writing small independent program!  Or should such sensitive components be built in native code (for example, VC++) and call them via ?
34071
Consider this:  public class TestClass {      private String a;     private String b;      public TestClass()     {     a = "initialized";     }      public void doSomething()     {     String c;          a.notify(); // This is fine     b.notify(); // This is fine - but will end in an exception     c.notify(); // "Local variable c may not have been initialised"     }  }   I don't get it. "b" is never initialized but will give the same run-time error as "c", which is a compile-time error. Why the difference between local variables and members?  Edit: making the members private was my initial intention, and the question still stands...
63578
I'm trying to understand the difference between the following and what they actually mean :   Known plaintext attack Known ciphertext attack Chosen ciphertext attack Chosen plaintext attack   Any clarification is much appreciated…
7915
I understand the basic difference between an interactive shell and a non-interactive shell.  But what exactly differentiates a login shell from a non-login shell?  Can you give examples for uses of a non-login interactive shell?
4599
Is there are rule when to use opened vs open?  I always get confused even though I've been speaking English as the dominant language for more than half my life.  E.g.         Is the door open(ed)?   Which file do you have open(ed) in your editor?
7441
Was there any reason why the designers of Java felt that local variables should not be given a default value? Seriously, if instance variables can be given a default value, then why can't we do the same for local variables?  And it also leads to problems as explained in :     Well this rule is most frustrating when trying to close a resource in a finally block. If I instantiate the resource inside a try, but try to close it within the finally, I get this error. If I move the instantiation outside the try, I get another error stating that a it must be within a try.      Very frustrating.
46507
What do I do? I looked at a similar question to mine and there was an answer saying to make sure Java is allowed past the firewall. So I checked and it already is. I've tried uninstalling and installing both Minecraft and Java but nothing has changed.  says that all services are fine, so what's going on? I bought a 2nd account to use as an alternative in-game account and now I can't log in.  (I cleared the email and password boxes for obvious reasons in this screenshot: security purposes)
75472
Ok this is a basic question but i am not able to figure out how does this work  1: This is the representation of the RS Flip-Flop with the truth table given in my  book    I am not able to connect the truth table to the representation as inn my knowledge every time the answer should be same, which i know that i am wrong so please help me.  2: what does Disallowed and no change stands for.  Thanks  Akash
7594
Since I've a database systems examination in less than 3 hours (from now), I have been browsing Stack Exchange network for questions with normalisation and related tags. Most of the questions are now closed as  or others from the list.  Since, these questions are closed, no users are allowed to post answers to them (unless they are reopened). Why am I, then, allowed the option to protect such questions? Doesn't that beat the entire purpose behind "protecting" a question?
2635
I am not able to get the meanings of DB Session  status. I searched it for some references, but not getting any help. Can anyone explain these status (runnable, sleeping, suspended, running and background) what actually means, that would be help me a lot. Thanks in advance.
12184
I'm trying to get an understanding of what the the java keyword this actually does. I've been reading Sun's documentation but I'm still fuzzy on what this actually does.
77567
I've read in the  and the  the mention of inner classes. What is their purpose?  I see in the Apex Workbook that they used private variables and setter/getter methods in the inner class, but why didn't they just do that in the outer class with a constructer, getter, and setter?
24641
We put all of our unit tests in their own projects.  We find that we have to make certain classes public instead of internal just for the unit tests.  Is there anyway to avoid having to do this.  What are the memory implication by making classes public instead of sealed?