logo

CuriousTab

CuriousTab

Discussion


Home Interview Technology Comments

  • Question
  • If sub class data member is hiding super class data member then how to access super class data member inside sub class methods?


  • Correct Answer
  • use super keyword super keyword points immediate super class Class Sample { int a =23; } Class Sub extends Sample { String a = "bablu"; void show() { Systemoutprintln(a); //bablu System out println(thisa); //bablu System outprintln(supera); //23 } } Class Demo { Public static void main(string[] args) { sub s = new Sub(); sshow(); } } 


  • Technology problems


    Search Results


    • 1. What is the fastest type of JDBC driver ?
    • Discuss
    • 2. What is a package?
    • Discuss
    • 3. Which of the following are valied?

    • Options
    • A. A class can extend any number of classes simulteneously
    • B. A class can implement only one interface at a time
    • C. A class can extend other class or can implement interface but not both simulteneously
    • D. None of the above
    • Discuss
    • 4. X implements Y extends Z

    • Options
    • A. X can be class Y,Z are interfaces
    • B. X is an interface Y,Z are classes
    • C. X,Y are classes Z is an interface
    • D. Complilation error
    • Discuss
    • 5. What is Marker Interface?
    • Discuss
    • 6. How can you make sure your dependencies are safe ?
    • Discuss
    • 7. What is the difference between creating String as new() and literal ?
    • Discuss
    • 8. How do you handle error condition while writing stored procedure or accessing stored procedure from java ?
    • Discuss
    • 9. Which is a reserved word in the java programming language?

    • Options
    • A. Variable
    • B. Identifier
    • C. Keyword
    • D. Main
    • Discuss
    • 10. Which of the following best describes JavaScript?

    • Options
    • A. a scripting language precompiled in the browser.
    • B. an object-oriented scripting language
    • C. a low-level programming language.
    • D. a compiled scripting language.
    • Discuss


    Comments

    There are no comments.

Enter a new Comment