Programming Quiz 1.

3 Questions | Total Attempts: 48

Please wait...
Programming Quizzes & Trivia

Simple Quiz

Questions and Answers
  • 1. 
    Why do we use use this code? "Button.setOnClickListener(this);"
    • A. 

      To check if the button is connected

    • B. 

      To set a click listener which then sets a new sub to type in commands once the button is pressed.

    • C. 

      To set a listener to make it so when the button is clicked it would be reconized.

  • 2. 
    Button = (Button)findViewById(; makes us find the button we made in Main.xml
    • A. 


    • B. 


  • 3. 
    What is this code? public void onClick(View src) { // TODO Auto-generated method stub switch(src.getId()){ case     break; } }
    • A. 

      This code allows us to create a button

    • B. 

      This code allows us to set what a button does

    • C. 

      This code makes a new button bigger