stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Programming 1 Unit 2 Flashcards | StudBud
Explore
/
Programming 1 Unit 2
What is encapsulation?
What does String.indexOf(String str) do?
Programming 1 Unit 2
27 terms
·
StudBud Administration
·
222 plays
#programming
Flashcards
27 cards
F
Practice quiz
P
Host live
L
Questions
27
Answers
1
What does String.indexOf(String str) do?
Returns the substring after 'str' is removed from String
Returns the position of 'str' within the String, or -1
Returns the substring before 'str' in String
Returns the substring after 'str' in String
2
What is encapsulation?
Allowing users to manipulate the data directly
Hidden class methods so that users cannot abuse them
Keeping some data private, others cannot access it directly
Putting our object instances inside a dedicated code block
3
For a variable 'jon' of class 'Person' with a method 'getMoney' which is correct?
Person.getMoney()
jon.getMoney()
Person.jon.getMoney()
jon->getMoney();
4
What does API stand for?
All Product Information
Application Production Information
Application Programming Interface
Application Program Inteligence
5
What is a class member?
The instances of a class
The class references
The class declaration
The fields and methods in the class
6
Using classes allows us to reuse code that's already written?
True
False
7
What is a "getter"?
A class method that returns object data
A class method that prints out object data
A class method that instantiates an object
A class method that changes object data
8
What does an Object reference do?
Is the blueprint for creating new objects
Points to the location in memory of the object
Is used to check that the object has correct data
Contains all of the objects data
9
Which is the wrapper class of 'int'?
INT
Int
integer
Integer
10
If an object reference does not point to an actual object what is its value?
null
absent
void
none
11
What is the purpose of the 'toString()' method?
Return a String representing methods available to the class
Return a String representing the number of object references
Return a String representing the data of the object
Return a String representing the structure of the class
12
Which of these is a static class?
Math
Scanner
String
DecimalFormat
13
Which method will return the character at a certain position?
String.text[int];
String[int];
String.char(int);
String.charAt(int);
14
How do you create a instance of a class?
Class myClass = Class.new();
Class myClass = new Class();
Class myClass = new Class;
Class myClass = Class();
15
Class names start with a Capital?
True
False
16
What is a "setter"?
A class method that prints out object data
A class method that returns object data
A class method that changes object data
A class method that instantiates an object
17
What is an instance of a class?
A value stored in the class object
A blueprint of what the class will contain
An object that was created from that class
A method that the class can call
18
What is a class constructor?
A special field that contains the object reference
A special method that creates the object and sets values
The special class that creates all of our other classes
A special method that references the object
19
What does the Scanner class do?
Scanner looks through user input looking for keywords
Scanner reads images as input
Scanner finds errors and viruses in our code
Scanner parses input into tokens
20
A 'String' is an object?
True
False
21
An object can have multiple references to it?
False
True
22
What package contains DecimalFormat?
java.util
java.lang
java.text
java.io
23
Object references start with a Capital?
True
False
24
What is the standard input (keyboard)?
System.input
System.in
System.inputStream
System.keyboard
25
What is Object-Oriented Programming?
Combine data and methods to represent specific concepts
Code that works on 3D model objects
Using multiple arrays to store small portions of our data
Code used to navigate the open seas
26
Why use classes?
To manipulate a bunch of data as one unit with common code
To keep the data separate from the methods
So the peasants don't revolt
27
What String method will return a sub-part of a String?
String.substring()
String.split()
String.portion()
String.seperate()