Sign In | Subscribe

Enter your Sign on user name and password.

Forgot password?
  • Follow us on:
Start learning today, and be successful in your academic & professional career. Start Today!
Loading video...
This is a quick preview of the lesson. For full access, please Log In or Sign up.
For more information, please see full course syllabus of Introduction to Java
  • Discussion

  • Study Guides

  • Download Lecture Slides

  • Table of Contents

  • Related Services

Lecture Comments (5)

1 answer

Last reply by: Professor Quayle
Mon May 6, 2013 2:06 AM

Post by A Debnath on May 5, 2013

Hi Professor Quayle,

The AP Exam is in a couple of days, and though I am feeling very comfortable with the free response section of the exam, I'm still finding the multiple choice questions quite challenging. Are there any multiple choice practice resources that you recommend? Thanks!

2 answers

Last reply by: Professor Quayle
Tue Apr 30, 2013 1:42 PM

Post by Alex Moon on April 28, 2013

I have a few questions....


Does == only check reference?
For example, if
int a = 5
int b = 5
a == b would be false?


Here is what I know.

When elements of array y are changed, same change could be observed in array x.

Q: How do you make x and y separate such that a change in x will not reflect change in y?
Would I need to copy each element through iteration? Would I need to declare "new String[10]"?


Under what circumstances could I "upcast"? (cassting to higher class)

Student s = new Person();
(Person)s ;


I encountered this:

BoxBug bb = new BoxBug();
if ( !bb.canMove())
{ bb.turn();}

why does this result in a compile-time error?

5. When class Student does not have a "no-args" constructor, how come I cannot call "new Student()", when compiler is
supposed to provide a default no-args constructor? In which cases would the default no-args constructor be provided?

6. Consider
Integer intOb = new Integer(3)
Object ob = new Integer(4)


apparently, Barrons says on one of the questions, that this will cause an error.
Strangely, enough, Barrons explained in a chapter that CompareTo automaticall casts the parameter into Integer,
and thus the statement would be legal.

Which is correst? Did Barrons lie to me?

7. If not overriden, does the default equals() method of Object act like == operator? (only comparing the reference)

8. Consider this

Class A

public A()

public void methodOne()

Class B extends A
public B()

public void methodOne()

Code belod is executed

A object = new B();

Litvin's book says that this happens:

new B() --calls--> A() --calls--> B.methodOne() --print--> "B" --print--> "*",

resulting in

I still don't understand why the A() constructor was called when "new B()" was called!
There was not even a "super()"!

Thank you so much. I hope I'm not bothering you with all these questions. Only a few days until the exam!

Final Tips for Taking the Exam

  • Answer the questions in any order you want
  • Each question in a section is worth the same amount toward the score for that section, so don’t spend excessive time on any question
  • If you get stuck on a question, go on and come back to it later
  • No penalty for wrong answers in either section, so mark an answer for every multiple choice question and write something in response to every free response question
  • Use the Quick Reference Guide to confirm your answers related to standard classes or GridWorld classes, but study this information in advance

Final Tips for Taking the Exam

Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.

  • Intro 0:00
  • Roadmap 0:10
  • AP Computer Science Exam Structure 0:46
    • Two Sections
    • Scoring
  • Multiple Choice Strategies and Tips 2:15
    • Answer Questions for Descriptive Paragraph First
    • No Penalty for Wrong Answer
  • Free Response Strategies and Tips 4:00
    • Each Part Graded Separately
    • All Answers Written in Java
    • Partially Correct Solutions
    • Write Neatly
    • Draw a Single Line Through Mess-Ups
  • Additional Resources 14:49
    • Download the Project Files for GridWorld
    • Download Reference Documents
    • Remember, You Can Watch This Lesson More Than Once
  • What to Bring to Your Exam 16:19
  • What Not to Bring to Your Exam 18:47
  • The Night Before Your Exam 22:00
  • The Day of Your Exam 24:23
  • Summary 26:44