logo

CuriousTab

CuriousTab

Discussion


Home Interview Technology Comments

  • Question
  • How to call argument constructor?


  • Correct Answer
  • new ClassName( arg1, arg2, argN); Ex: Class sample { Sample(int a) { Systemoutprintln("arg con a =" +a); } } class Demo { Public static void main( String[] args) { Sample s1= new Sample(23); Sample s2= new Sample(45); } } 


  • Technology problems


    Search Results


    • 1. What is Constructor?
    • Discuss
    • 2. What is difference between methods and blocks?
    • Discuss
    • 3. In a class if private data member is declared then how to get value of that data member?
    • Discuss
    • 4. In a class if private data member is declared then how to set data to that private data member?
    • Discuss
    • 5. What is the differnce among public, protected and package access data?
    • Discuss
    • 6. What is different among String, StringBuffer, StringBuilder?
    • Discuss
    • 7. What is wrapping?
    • Discuss
    • 8. What is unwrapping?
    • Discuss
    • 9. What is JAR file? what are the main uses of JAR files?
    • Discuss
    • 10. What is the difference between path and classpath?
    • Discuss


    Comments

    There are no comments.

Enter a new Comment