Study sets, textbooks, questions
Upgrade to remove ads
CS Awesome - Unit 7 Vocabulary
Terms in this set (13)
Automatically wrapping a primitive type in a wrapper class object. For instance if you try to add an int value to a list, it will automatically be converted to an Integer object.
A method that only has a declaration and no method body (no code inside the method).
An ArrayList can hold many objects of the same type. It can grow or shrink as needed. You can add and remove items at any index.
You can add an object to the end of a list using listName.add(obj). You can add an object at an index of a list using add(index,obj). This will first move any objects at that index or higher to the right one position to make room for the new object.
To declare an ArrayList use ArrayList<Type> name, where Type is the class name for the type of objects in the list. If you leave off the <Type> it will default to Object.
To create an ArrayList use new ArrayList<Type>, where Type is the class name for the type of objects you want to store in the list. There are other classes that implement the List interface, but you only need to know the ArrayList class for the exam.
To get an object at an index from a list use listName.get(index).
You can access and set values in a list using an index. The first element in a list called list1 is at index 0 list1.get(0). The last element in a list is at the length minus one - list1[list1.size() - 1].
To remove the object at an index use ListName.remove(index). This will move all object past that index to the left one index.
To set the value at an index in a list use listName.set(index,obj).
Use listName.size() to get the number of objects in the list.
Classes used to create objects that hold primitive type values like Integer for int, Double for double and Boolean for boolean.
Automatically converting a wrapper object like an Integer into a primitive type such as an int.
what is the correct way to assign the pointer p to the address of x?
in php, how to check if a value exist for a key?
Assuming that x and y are equal to 3 and 2, respectively, after the statement x -= y executes, the values of x and y will be:
With an enumerated data type, the enumerators are stored in memory as....
Recommended textbook explanations
Introduction to the Theory of Computation
John Buck, William Hayt
Computer Organization and Design MIPS Edition: The Hardware/Software Interface
David A. Patterson, John L. Hennessy
Lab Manual for Malik's C++ Programming: From Problem Analysis to Program Design
D. S. Malik
Sets found in the same folder
CS Awesome - Unit 2 Vocabulary
CS Awesome - Unit 5 Vocabulary
CS Awesome - Unit 6 Vocabulary
CS Awesome - Unit 1 Vocabulary
Other sets by this creator
CS Awesome - Unit 10 Vocabulary
CS Awesome - Unit 9 Vocabulary
CS Awesome - Unit 8 Vocabulary
CS Awesome - Unit 4 Vocabulary
True/False: A substitution cipher is a good way to keep sensitive information secure.
True/False: A simplified version of a program is called a simulation.
Write a program that prompts the user to provide a single character from the alphabet. Print Vowel or Consonant, depending on the user input. If the user input is not a letter (between a and z or A and Z), or is a string of length > 1, print an error message.
Let M(n) be the time to multiply two n × n matrices, and let S(n) denote the time required to square an n × n matrix. Show that multiplying and squaring matrices have essentially the same difficulty: an M(n)-time matrix-multiplication algorithm implies an O(M(n))-time squaring algorithm, and an S(n)-time squaring algorithm implies an O(S(n))-time matrix-multiplication algorithm.