Search:

Type: Posts; User: hs82

Search: Search took 0.18 seconds.

  1. Replies
    2
    Views
    7,585

    what is ... (triple dot) operator

    What is the use of ... (triple dot operator)

    for Example please explain below code :

    public PausableThreadPoolExecutor(...) { super(...); }

    From which JDK version it was introduced.. ?
  2. Thread: synchronized

    by hs82
    Replies
    1
    Views
    129

    synchronized

    I want to know the exact use of following two :

    static synchronized(lock){ // (if lock is static and if lock is non-static)
    // Accessing some objects (static only as here non-static data will not...
  3. Replies
    16
    Views
    265

    Re: Comparison of Objects and such

    Thanks. It was very good and in depth discussion.

    I really appreciate the views given by you that make my concept more clear.

    Thanks a lot :o
  4. Replies
    16
    Views
    265

    Re: Comparison of Objects and such

    I agree that == should never be used for comparing two objects.

    For this particular case or in any case == should never be used.

    But I want to know what is the best way to create String...
  5. Replies
    16
    Views
    265

    Re: Comparison of Objects and such

    Thanks you so much, for such a clear and logical explanation.

    String s1 = new String("TEST");
    String s2 = new String("TEST");

    In this case two Objects are created, with pointing to same string...
  6. Class level lock and Object level lock - difference

    I want to know the exact use of following two :

    static synchronized(lock){ // (if lock is static and if lock is non-static)
    // Accessing some objects (static only as here non-static data will...
  7. Replies
    16
    Views
    265

    Re: Comparison of Objects and such

    I agree that we shall never use == operator to compare two objects.

    Can you please explain little more about what you said about Compiler optimization in case of my code. Also will the String...
  8. Replies
    16
    Views
    265

    Re: Comparison of Objects and such

    Yes.. Because I have tested this using above code.
  9. Replies
    16
    Views
    265

    Re: Comparison of Objects and such

    Please run following code and decide :

    public class StringMatch {

    public static void main(String[] args) {
    String s1 = "TRUE";
    String s2 = "TRUE";
    if(s1 == s2){...
  10. Replies
    0
    Views
    154

    Class level Lock vs Object level lock

    I want to know the exact use of following two :

    static synchronized(lock){ // (if lock is static and if lock is non-static)
    // Accessing some objects (static only as here non-static data will...
  11. Replies
    16
    Views
    265

    Re: Comparison of Objects and such

    String1 and String2 both are reffering same data in String pool.

    So String1 == String2 will be TRUE (As both variables referring same data)

    And String1.equals(String2) will be TRUE (As both...
Results 1 to 11 of 11