logo

CuriousTab

CuriousTab

Discussion


Home Interview Technology Comments

  • Question
  • What do you understand by private, protected and public?


  • Correct Answer
  • These are accessibility modifiers Private is the most restrictive, while public is the least restrictive There is no real difference between protected and the default type (also known as package protected) within the context of the same package, however the protected keyword allows visibility to a derived class in a different package 


  • Technology problems


    Search Results


    • 1. What is Thread ?
    • Discuss
    • 2. What is the difference between creating a thread by extending Thread class and by implementing Runnable interface? Which one should prefer?
    • Discuss
    • 3. What are the the different ways for creating a thread?
    • Discuss
    • 4. How does a try statement determine which catch clause should be used to handle an exception?
    • Discuss
    • 5. What is static initializer block? What is its use?
    • Discuss
    • 6. If a method is declared as protected, where may the method be accessed?
    • Discuss
    • 7. What is the difference between method overriding and overloading?
    • Discuss
    • 8. What is classloader?
    • Discuss
    • 9. What will be the output of the following code snippet? Object s1 = new String("Hello"); Object s2 = new String("Hello"); if(s1 == s2) { System.out.println("s1 and s2 are =="); }else if (s1.equals(s2)) { System.out.println("s1 and s2 are equals()"); }
    • Discuss
    • 10. What is JDBC ?
    • Discuss


    Comments

    There are no comments.

Enter a new Comment