Programming Quiz 1.

3 Questions | Total Attempts: 48

SettingsSettingsSettings
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(R.id.Button01); makes us find the button we made in Main.xml
    • A. 

      True

    • B. 

      False

  • 3. 
    What is this code? public void onClick(View src) { // TODO Auto-generated method stub switch(src.getId()){ case R.id.Button01:     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