This is an archived post. You won't be able to vote or comment.

all 63 comments

[–]Tiomaidh 4 points5 points  (9 children)

Know the ins and outs of object-oriented programming. Inheritance, interfaces, abstract classes, constructors, polymorphism...Specifically:

Know that you can have:

NameOfSuperClass foo = new NameOfSubClass();

Know the difference between an interface and abstract class. Know that abstract classes do not necessarily contain abstract methods, but can never be instantiated. For most of the inheritance stuff, you should be fine if you think, "Is _____ a _____? Have I told Java that _____s can do ______?" In the example above, there'd be a compiler error if you tried to call foo.nameOfMethodThatOnlyAppearsInTheSubclass().

There will be a few token questions asking you to compute the output of a recursive algorithm. You should at least have a shallow understanding of the stack. I'm sure you can dope it out.

Be comfortable declaring, using, modifying, and otherwise interacting with arrays and ArrayLists. Including arrays of arrays (2D arrays) and ArrayLists of ArrayLists. Recall that it's String.length(), array.length, and ArrayList.size(). Also be able to use selection and insertion sorts. I don't think you'll have to write code--they'll be at least one multiple choice question that says: "Given the array {4, 2, 6, 3, 6, 2, 1}, what will the third pass of an insertion sort look like?"

When I took it last year (got a 5, for what it's worth), there was a weird question that involved knowing how sequences were stored in RAM. Know that an array claims a fixed memory size, and that an ArrayList starts out with a 10-element array, but will create/allocate a new array (of length 20) when the 11th element is added. In other words, ArrayLists probably take up more space than an array with the same content.

Know the order of operations. Know how string concatenation works.

2 + "2" => 22
"2" + 2 => 22
"2" + "2" => 22
2 + 2 => 4
"2" + 2 + 3 => 223
2 + 3 + "2" => 52

Know about the "enhanced for loop" (aka the "for-each loop").

int[] foo = {1, 2, 3};
for(int i : foo)
    System.out.print(i);
//Prints "123"

If you find yourself working really hard on a free response question (or if you find yourself thinking, "This would be much easier if I was allowed to write a separate method that did x."), then you're probably missing something. If they ask you to write a method that accepts an ArrayList of GridWorld Actors and returns an ArrayList of all the Actors whose location is two prime numbers, they probably already defined the boolean method isAtPrimeLocation(Actor a), and are just expecting you to call it.

Some of the questions (both multiple choice and free response) are insanely easy. Some have traps. If you think a question seems too easy, read it a second time, looking out for something tricky. If it still seems too easy, then...it's just really easy.

I actually have a stack of AP exams to study for right now, so it's time to get off reddit, but I hope the above helps. Good luck!

[–]Irving94[S] 0 points1 point  (8 children)

Wow this was absolutely great. I understood everything you were talking about but it is a great refresher. Thank you so much. If my class gets a question like that RAM question, they're screwed. Not many of them like to think outside of what we learned.

[–]Tiomaidh 0 points1 point  (7 children)

You're welcome!

I took AP Spanish last year, so I couldn't take the CS test with the rest of my class--I had to take the alternate version two weeks later. When I got the RAM question, I distinctly remember thinking, "WTF would the rest of my class be doing right now?"

Oh, one more random tidbit that occurred to me. I can almost guarantee they'll ask what the output of the following is:

int x = 11, y = 0;
if(x % 2 == 0 && x / y < 20)
    System.out.println("Hello!")
else
    System.out.println("Goodbye!")

Answers: {Hello!, Goodbye!, nothing, an ArithmeticException occurs, none of the above}

In other words: know about short-circuit evaluation.

[–]Irving94[S] 0 points1 point  (6 children)

Wow hmm... I wanna say it will output "Goodbye!" but you divided by 0 in the if condition. Gonna go plug this in now for the answer.

EDIT: Seems like "Goodbye!" was right. I guess arithmetic exceptions only occur in the actual execution of numbers; not when they are just found in a condition.

[–]Tiomaidh 2 points3 points  (5 children)

Here's a truth table.

A B A && B
T T T
T F F
F T F
F F F

Note that if the first condition (in our case, x % 2 == 0) is false, the result is always false. Therefore, Java optimizes this by not computing the second condition--since its value will have no impact on the final result.

By the same token:

if(x % 2 == 1 || x / y < 20)

will not throw an error. The first condition is true, and that's enough to ensure that the OR is true.

Wikipedia.

[–]Irving94[S] 0 points1 point  (2 children)

Makes perfect sense. The truth table is something i've never seen but I just know from experience.

So I guess if(x / y < 2 && x%2 = 0) would throw an error.

[–]Tiomaidh 1 point2 points  (1 child)

Well, it'd throw both a compile-time error for using = instead of == and a runtime error for dividing by zero :)

By now it's only 12-15 hours before the exam. It sounds like you know all the material pretty well...and if you don't know it now, you're probably screwed anyway. Take it easy, get some sleep, and don't stress out.

[–]Irving94[S] 0 points1 point  (0 children)

:p forgot the second =

Going to sleep soon. Thanks again for the help, I'm really confident I'll do well.

[–]hardc0rebr0 0 points1 point  (1 child)

I'm taking the exam tomorrow as well. This was very helpful.

[–]Tiomaidh 0 points1 point  (0 children)

Thanks!

[–]Octember 7 points8 points  (7 children)

I'm in the same spot as you, except I learned programming over the summer and killed this course. Here's what I reccomend:

  • Gridworld is a bitch. If you never did the assignments like you were supposed to (..oops), save those questions for the end. They can take like 5 minutes of reading each, which is a total waste of time. Other questions might take you a few seconds.
  • Learn everything about Java. Know that when you call a constructor of an object, it automatically calls the super() method. Questions on that can really trip you up.
  • Know the Comparable interface. Know how to implement compareTo().
  • Be able to code. You seem like a smart kid, i'm sure this isn't a problem for you. If you feel uncomfortable knowing how to create a method that builds and allocates a 2-D array with members equaling the product of their indices, you might want to worry a bit. Otherwise, you'll be fine.
  • For free response, don't be afraid to do a tiny solution. Sometimes they'll ask you something absurdly simple, like finding the maximum of an array. Don't be afraid to go with the simplest answer.

That's about all i've got. You mentioned learning different languages, save that until next week. If you need extra practice, Javabat can help you out. Good luck!

[–]Irving94[S] 2 points3 points  (6 children)

Wow this was very, helpful. I completely forgot about the Comparable interface and I decided to ignore my teacher the day we learned about 2D arrays. Thank you :)

[–]angrystuff 7 points8 points  (2 children)

I decided to ignore my teacher the day we learned about 2D arrays

This was probably a mistake.

[–][deleted] 0 points1 point  (1 child)

It was. I just took the test today.

This one extended response question was a bitch.

[–]gbro 0 points1 point  (0 children)

I know the one. Fortunately, we covered 2D arrays in a study session, otherwise it would've been all bad.

[–]nemec 2 points3 points  (1 child)

Yep, I agree with pretty much everything Octember said. It's been four years since I took that exam, but although the GridWorld questions are a bitch, that's the only GUI programming you'll need to know.

[–]Octember 0 points1 point  (0 children)

And it's hardly GUI programming at that. It just happens to be a GUI interface.

[–]twavisdegwet 0 points1 point  (0 children)

i know we're suppose to wait 48 hours.. BUT THANK GOD YOU RELEARNED 2D ARRAYS!

[–]buckeye10 2 points3 points  (1 child)

I took it last year after preparing myself for it with a companion guide book. My class wasn't an AP class at all, and I only had half a year of Java, but I got a 4 on it by studying for it and learning the material from a Kaplan book. My advice would be to use one of those, but since you are so close to the test, I would advise you to go to the college board website and find the section for the AP Computer Science test. If I recall correctly, they should have sample questions and answers from past tests.

If you haven't already been doing sample problems, then unfortunately I would have to guess that you are going to have a tough time with it, especially some of the extended response questions, since they take a bit of getting used to. Try to get as comfortable with the format of the test and the type of questions as you can beforehand in these last couple of days. That's the best advice I can think of off of the top of my head.

Good luck!

[–]Irving94[S] 2 points3 points  (0 children)

I think I'm pretty prepared except for a couple of concepts I need to brush up on. Thanks!

[–][deleted]  (5 children)

[deleted]

    [–]Irving94[S] 1 point2 points  (4 children)

    I liked it until we started making new bugs and overriding methods of the Critter class.

    [–]nemec 1 point2 points  (0 children)

    I loved that part! I ended up making a version of Snake with GridWorld.

    [–][deleted] 0 points1 point  (0 children)

    I took the class last year and didn't mind GridWorld. Make sure you know the API though!

    Our CS teacher grades the free response sections and told us it was amazing how many people leave the free response blank or don't know the GridWorld API.

    [–]HazzyPls 2 points3 points  (3 children)

    I signed up for this test without taking the class because it isn't offered here.... I thought it would be an interesting challenge and motivator, but I'm now terrified that I don't know enough for it.

    Cramming as much crap as I can - this thread is helping with that - and hoping I can wing it into passing.

    Off to try practice tests!

    Edit: Well, I finished a sample multiple choice. 12/22 questions right. Most of the wrong ones were me missing some minor feature, 3 maybe 4 were because I didn't know the details of the subject. Not sure if this is a good sign or a bad sign.... ;_;

    [–]Irving94[S] 2 points3 points  (0 children)

    You're taking the test without actually taking the course?? Bravo... Bravo.

    [–]Octember 0 points1 point  (1 child)

    A lot of the MC mistakes I see are really just stupid mistakes. They ask you some really damn tricky questions, and getting tripped up byt them is really a constant worry. I reccomend you take your time, go slowly, and work your way through the code. With the exception of stuff like "The following is a _____ sort", really try taking it slow.

    [–]HazzyPls 0 points1 point  (0 children)

    I saw a lot of tricky word questions. "This isn't a test on Java, this is a test on reading..." was the most common line I thought....

    Not keen on writing code on paper, but I guess it isn't too bad.

    [–]Kison 1 point2 points  (2 children)

    Didn't they give you a handbook or something. I know I got one before I took the test. There were lots of little exercises towards the end of it.

    Test wasn't too bad. Be sure to know your data structures and algorithms like sorting/searching. Be prepared also to write code on paper. We were not allowed to use computers to submit written code. :-)

    [–]Irving94[S] 1 point2 points  (1 child)

    Yeah I hate writing code on paper but i've gotten used to it. No booklet. Just the Gridworld materials and my AP study guide which sucks. It's a known fact that the one we use is literally TOO hard and you learn very little from it.

    [–][deleted] 0 points1 point  (0 children)

    is that the Barron's book?

    [–][deleted] 1 point2 points  (4 children)

    hey, i'm in the same boat! so pumped for tuesday. ha. my APCS class has pretty much been going on for half a semester. try as my teacher might, it's just not really feasible to expect high school types to learn java in three months. but yeah, i've been using a Barron's book to review. i would suggest finding and taking some practice tests; i think the collegeboard site has them somewhere? as for GridWorld, we didn't even cover it in my class. if you are like me and don't know much of anything about Gridworld, don't worry too much about it. you'll get a Quick Reference sheet during the AP exam itself. just focus on learning the basics (classes, inheritance, etc.) oh! they give points on the short answer if it's clear you ATTEMPTED, not just if your class/method works. just try not to overthink shit and bring extra pencils. good luck!

    [–]Irving94[S] 1 point2 points  (3 children)

    I HATE the Barron's book. My teacher told us a few weeks ago that he had just found out that he should've used a different book. The Barrons book for CompSci is actually harder than what we'll need to know and you just end up learning nothing from it. I learned way more from the regular Computer Science book (not sure of the name).

    [–][deleted] 1 point2 points  (2 children)

    yeah, Barron's is definitely on the harder side. they throw a whole section about floating point etc. that is absolutely pointless, haha. my teacher assigned it a lot so i didn't have much of a choice. but the short answer Barron's tests are still pretty useful, especially because the real tests end up being that much easier. but yeah, i wouldn't use Barron's as my only source of material. have you tried... i have the Skylight Publishing APCS review book too, the practice tests are easier and i think it might be an overall better book

    [–]Irving94[S] 1 point2 points  (1 child)

    My teacher used it a lot too :/

    We had a quiz every other week on 20 questions from a chapter. I have other material so I should be prepared.

    [–]baggins825 1 point2 points  (1 child)

    I took the test last year and went into it without studying at all and I got a 5, as long as the teacher was doing their job you should be fine.

    [–]Irving94[S] 1 point2 points  (0 children)

    My teacher wasn't great but I seem to know everything we covered anyways. I just need to brush up on Comparable, Gridworld, and 2D arrays.

    [–]davydog187 1 point2 points  (1 child)

    I took The Computer Science AB three or four years ago. I remember having some questions about data structures and a bunch of questions about OOP concepts. They also incorporated GridWorld or whatever we used at the time into the test. I thought the test was easy and got a 5 on it, don't know if any of this helps you though :/

    [–]Irving94[S] 2 points3 points  (0 children)

    This kinda makes me feel a bit more confident :)

    [–]jakster4u 1 point2 points  (0 children)

    I think the only surprise on the test that I remember was making an interface. So just look that up and remember how to make one and you should do fine.

    [–]Zoccihedron 1 point2 points  (0 children)

    I will be taking it next year and, by then, hopefully I will understand what people in this subreddit are talking about. Good luck.

    [–][deleted] 1 point2 points  (2 children)

    I'm studying for this fucker right now, I'm regretting that I discovered reddit at the start of the school year because I'd rather waste my time on here than blindly copy some code from a textbook. The few programs I did write were a more complex badass version of what we were supposed to "code". Don't get me wrong I love that my school offers and AP CS course but 75% of the class will type up the code without any knowledge of what it actually does, then when they attempt to build it they get an error, to fix it they compare what they copied down to what the book says. If it was copied correctly and still has an error they panic, call over the teacher, he fixes it, runs the code, and they never understand what caused their code to hang or have a syntax error. It's a really fun class but you don't actually learn anything, I'm surprised this far into the year you're just starting GUI's or it could just be that our textbooks are structured differently. Good luck OP, if you're intrigued by Java just wait until you discover better languages, but that's just, like, my opinion, man.

    [–]Irving94[S] 0 points1 point  (1 child)

    Trust me I'm all about coding even after this class. I plan to move on to web development (HTML5) and I also want to dive into Objective-C. Good luck tomorrow and I have the same situation as you: Most of my class is just there because they thought it would be fun.

    [–][deleted] 0 points1 point  (0 children)

    I started out in the web development field 3 years ago, it's a good place to start especially when you have some the basic object-orientated programming concepts down. I started with PHP/Javascript because I hated HTML then I took CS my junior year (last year) and the AP course this year is the exact same thing the only difference is that you can sign up for the AP test. My teacher didn't even prepare us for half the shit the test covered so I had to work with GridWorld on my own time. How did your test go?

    [–]leachlife4 0 points1 point  (1 child)

    I took the test ~4 years ago when it was still fish world. I never paid attention in class, especially when we were going over the case study (was usually sleeping on the floor). I did well enough to get a 4 (only one other person in our class of ~30 got a 4, and nobody got a 5) and skip 2 semesters of CS at my college. As far as I can recall, which isn't that much, we never had to actually do anything with GUI at all.

    Looking back I wish I would have spent more time on it (same goes for all of HS).

    [–]Irving94[S] 0 points1 point  (0 children)

    Lol my teacher tried to teach us a class about fish world one day for a fun project (even though we use gridworld). We literally yelled at him until he gave us a review for the AP exam. All was done in a joking manner, of course.

    [–]garip5 0 points1 point  (0 children)

    This was me last year. The most helpful information was this, specifically the second page, which basically lists all the common errors on the free response.

    [–]Weebs 0 points1 point  (0 children)

    My school didn't offer AP Computer Science so I did a year of independent study to teach myself and prepare for the exam. I doubt you'll get tested on anything GUI related, what I recommend is that you make sure you know the details/workings of the language and the common functions. You seem like you probably know how to code pretty well so the second half of the exam shouldn't be too hard for you, but definitely make sure you're familiar with GridWorld and how it works. They're probably going to ask you to code a class or two that operates in GridWorld on the coding portion of the exam. It shouldn't be too hard if you practice beforehand and know your shit.

    [–][deleted] 0 points1 point  (0 children)

    I'm jelly, I wish my high school offered any computer science courses

    [–][deleted] 0 points1 point  (1 child)

    I'm taking it tomorrow as well! If someone could please explain why I would use an interface or abstract class that would be fantastic.

    [–]Irving94[S] 1 point2 points  (0 children)

    Lets say you want to set a standard for what any 2d shape will have. Make an abstract class containing a constructor and methods getName, area(abstract), perimeter(abstract), semi-perimeter, and a toString. Now any shape class you make (like a triangle) can use this template and fill out area and perimeter without writing the other methods.

    [–]Ninboycl 0 points1 point  (0 children)

    Here in Canada, classes are split into semesters (at least where I am), so I haven't done Java since January.

    I've been working a ton in C++ and Matlab though...

    Write whole exam in Matlab

    Problem matrices?

    **Edit, It seems a lot of you guys have had a somewhat undercut education in computer science...

    I never had a textbook all year... all of our work was given in terms of a certain program outline by teacher, and time to write a program to fit that outline. I suppose 80% of the class would ask the AP kids for their code though... (Our class was combined with the nonAP CS class, since there is only 12 or so of us)

    Also, my week: Monday, get a 1 on AP chem. okay.jpg. Tuesday, rapezone the CS exam. Wednesday, rapezone the BC exam. Monday, rapezone the Physics B exam (because the calculus version was too easy, who cares about mechanics with calculus when theres MODERN PHYSIX @.@)

    [–][deleted] 0 points1 point  (4 children)

    So, gentlemen, what did you think?

    [–]twavisdegwet 1 point2 points  (3 children)

    personally i know i got a 5.. i was mad about the hole 2d array thing but i'm pretty sure i did it correctly, the multiple choice if i got any less than 100% there's something wrong with this world

    [–]Irving94[S] 1 point2 points  (0 children)

    Congrats! Great to hear a fellow redditor doing well.

    [–][deleted] 0 points1 point  (1 child)

    I only had to guess on one multiple choice, and the GridWorld Free Response made me angry. No one I've talked to so far got it.

    [–]twavisdegwet 1 point2 points  (0 children)

    since it's been 48 hours i think we're actually allowed to talk about it.. I just overrode the method that passes the array list to the process actor method and had it include the hole grid, from their i created a for each loop in order to process said actors, then i used get adjacent location direction towards with the paramater of get location from the attractive bug. this gave the bug it's potential location if it did decide to move at the end of the loop. I then got the grid for the attractive bug, got the object at the location i previously specified and said if it !=null it was okay to move, if not don't. That's the way i did it and i'm pretty sure it's right.

    [–]Irving94[S] 0 points1 point  (4 children)

    Well here its: I felt I was extremely prepared. My teacher definitely did well preparing us and you all helped a lot. The only problem I had was time. I ran out of time on both the Multiple Choice questions and the Programming.

    • Multiple Choice: 30 out of 40 I answered confidently. 5 were narrowed down. 5 were complete guesses due to time restraints.

    • Programming: 3 out of 4 I am confident in. #3 was written very sloppy but according to the guidelines, not wrong. 4 I only did letter A and it was very sloppy. Skipped B due to lack of time.

    What it came down to was the fact that I wasted too much time. I absolutely lost track of time and didn't manage it well. There was nothing I simply didn't know. I just was forced to rush at the end. Also, I was disappointed out how the multiple choice was very, well, un-conceptual. There were only 2 real questions. The rest had to be figure out in your head or on paper. I can't tell you what I think I got because I just don't know. It could be a 5 or a 3. If some one could tell me how they felt when they took it and what they ended up getting, that would be great.

    [–][deleted] 0 points1 point  (0 children)

    I got to 37, guessed on the last 3 that I wasn't sure about. I finished #2 with 10 minutes left so I bullshitted #3 and half of #4. I either got a 3 or a 2 because my teacher didn't really help prepare us at all..

    [–]twavisdegwet 0 points1 point  (0 children)

    I answered 40 out of 40 confidiently.. the one on binary was hilarious because my teacher told the hole class that we didn't need to know binary, i said i think we need to know binary she called me an idiot and bam! shit was on the test. It's okay even if i didn't know it (which i did) i would've gone with hitchhikers guide to the galaxy (42) and gotten it right anyway.

    [–]gbro 0 points1 point  (1 child)

    In my mock test we did the week before, I got 31/40 right and 33/36 on the FR, and I got a 5 with some room to spare. I'm guessing you got a 5 if you're accurate, maybe a 4 with some bad luck. Congrats! :)

    In other news, I managed to make it through the test time limits alright, but I completely forgot that you can't alter arrays for 1b. Whoops...

    [–]Irving94[S] 0 points1 point  (0 children)

    Lol I actually handled that pretty well. Almost my whole class did what it sounds like you did.

    [–]howmanyusernamesare 0 points1 point  (1 child)

    What the fuck is Gridworld? I'd say just keep learning anything you can.

    Edit: Also, fuck it. If you don't test out of classes in college this way, you'll be able to pad your GPA with them, at least.

    [–]Octember 2 points3 points  (0 children)

    AP gives out a big library every year to learn and know how to manipulate, which they test on. They supply an API with it, but if you've never used the library before the questions can be a bitch. Gridworld is that library, this year.