Day-05-Arrays - CSE116 CSE504 Introduction to Computer...

Info icon This preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE116 / CSE504 Introduction to Computer Science II Dr. Carl Alphonce 343 Davis Hall [email protected] Office hours: Thursday 12:00 PM – 2:00 PM Friday 8:30 AM – 10:30 AM OR request appointment via e-mail
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
PROFESSIONALISM Turn off and put away electronics: cell phones pagers laptops tablets etc. © Dr. Carl Alphonce
Image of page 2
ANNOUNCEMENTS Sign up for Piazza (up to 90% registration!) piazza.com/buffalo/spring2016/cse116 Recitation Attendance for full recitation time is expected ACM meeting Tonight @ 7:00 PM in Davis Hall, 2 nd floor atrium
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Today Writing tests Running JUnit MultiSet Coming up Arrays Defining the MultiSet ROADMAP
Image of page 4
MultiSet<E>, a.k.a. Bag<E> HashSet<E> MultiSet<E> ArrayList<E> Allows duplicates No Yes Yes Exposes order No No Yes Different Collection<E> classes
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Exercise Define a test to verify that a MultiSet<E> can contain duplicate items.
Image of page 6
channel 1
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
What is a correct order for these statements to make a JUnit test? 1) assertTrue("...",expected == actual); 2) int expected = 2; 3) ms.add(s); ms.add(s); int actual = ms.size(); 4) MultiSet<String> ms = new MultiSet<String>(); 5) String s = "River"; A. 4, 2, 5, 3, 1 B. 5, 3, 2, 4, 1 C. 2, 1, 4, 3, 5 D. 5, 4, 3, 1, 2
Image of page 8
What is a correct order for these statements to make a JUnit test?
Image of page 9

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern