Quiz
COP 3330 - Exam 1
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (65)
1Software objects share two characteristics of _______ and _______.
- AObject, class
- BInheritance, interface
- CState, behavior
- DFunction, method
- EProject, Package
2Benefits of modeling using objects in software include
- ACode re-use
- BInformation-hiding
- CModularity
- DPluggability and debugging ease
- EAll of the above
3The purpose of a class in object-oriented programming environment is to model the state and behavior of a real-world object.
- ATrue
- BFalse
4In object-oriented terms what is used as a blueprint to model a real-world object?
- AMethod
- BState
- CClass
- DBehavior
- EConstant
5Object-oriented programming allows for inheritance so commonly used state and behavior can be reused. The class that is inherited from is the ______ and the new class is the _______.
- ASuperclass, subclass
- BSubclass, superclass
- CInterface, subclass
- DClass, package
- EExtends, implements
6A declaration statement declares a variable. The following code is a correct example of a declaration statement: double value = 100;
- ATrue
- BFalse
7How many superclasses can a subclass extend when using inheritance in object-oriented programming using the Java programming language?
- AZero
- BOne
- CTwo
- DThree
- EUnlimited
8When using inheritance what does the new class inherit when it is derived from another class?
- AObject, class
- BInheritance, interface
- CFunction, method
- DState, behavior
- EProject, package
9When implementing an interface in object-oriented programming all ___________ must be included in the source code for the class to compile.
- AState
- BState and behavior
- CSuperclasses
- DConstructors
- EMethods
10What programming best practice should be used when identifying state and behaviors that are derived from another class or defined locally in the class?
- AComment the code
- BClass variables
- CLocal variables
- DParameters
- ENone of the above
11Local variables are commonly used in methods to store a temporary state. Local variables are visible __________.
- AGlobally
- BWithin the class
- CBetween the opening and closing braces of the method where they are declared
- DNot accessible
- EOutside of the class
12Given the signature for the required main method in the Java programming language public static void main (String[] args), what is args called from a variable perspective?
- ASignature
- BValue
- CConstant
- DField
- EParameter
13Compound assignment operators combine an arithmetic operator with the _________
- A+
- B-
- C*
- D=
- E%
14An expression can comprise
- AVariables
- BOperators
- CMethod invocations
- DVariable, Operators and Method invocations
- EVariables and Operators
15An expression statement forms a complete unit of execution with a termination semicolon. The following code is a correct example of an expression statement: Bicycle myBike = new Bicycle()
- ATrue
- BFalse
16Regarding source code, a block is a group of 0 ...n statements balanced between ________.
- A[]
- B()
- C/**/
- D// //
- E{}
17When using the switch decision-making statement the break statement is required.
- ATrue
- BFalse
18Control flow statements in source code files break up the flow of execution and allow for programs to execute blocks of code __________.
- ASequentially
- BBackwards
- CForwards
- DConditionally
- ENone of the above
19Which of the following is considered a decision-making statement?
- Aif
- Bif/else
- Cif/else if/else
- Dswitch
- EAll of the above
20Which of the following is considered a looping statement?
- Afor
- Bwhile
- Cdo/while
- Dfor, while, and do/while
- ENone of the above
21Which of the following is NOT considered branching statements?
- Agoto
- Bbreak
- Ccontinue
- Dreturn
- EAll of the above
22When using the if/else if decision-making statement the else leg is not required.
- ATrue
- BFalse
23When declaring a class which of the following component are REQUIRED?
- AClass name
- BClass body using {}
- CParameter list using ()
- DClass name and Class body using {}
- EClass name, Class body using {}, and Parameter list using ()
24Within a class, a method declaration has up to six components. The REQUIRED elements of a method declaration include __________, __________, __________, __________.
- AModifier, class name, parent class, comma separated list of interfaces implemented
- BClass body, constructors, fields, methods
- CMethod's return type, name , (), {}
- DModifier, return type, name, (), {}
- EEncapsulation, return type, name, {}
25What are the components of a method declaration that comprise the method signature?
- AMethod return a type and method name
- BMethod name and method parameter list
- CMethod return type and method parameter list
- DMethod return type, method name, and method parameter list
- EAll of the above
26The object-oriented concept of software resume allows a class to be created once and used __________.
- AAs many times as desired to include extending it using inheritance
- BNever
- COnce unless it is extended using inheritance
- DTen times or less
- EOnce unless it is implemented using interface
27A unique aspect of some object-oriented programming language is not having to explicitly declare a class constructor. This is true with the Java programming language. When instantiating an instance of a class and a class constructor has not been explicitly declared how is the following source code valid? Bicycle bike1 = new Bicycle();
- AIt is not valid
- BThe compiler automatically provides a no-argument constructor
- CThere would be a compiler error
- DThere would be a runtime error
- EIt is considered an overloaded method
28If a class explicitly declares a constructor that takes 0 ...n parameters when instantiated what happens to the default constructor of the class?
- AIt still exists and can be used to create instances of the class
- BIt is automatically created by the Java compiler
- CIt no longer exists
- DAll of the above
- ENone of the above
29The Java Application Programming Interface (API) includes predefined classes grouped into categories of related classes.
- ATrue
- BFalse
30Select the statement that is true about the Java programming language.
- AJava is case sensitive
- BWhite space is not ignored
- CSemicolons must be used at the end of variable
- DAll of the above
- ENone of the above
31If there are an unknown number of parameters being passed to a method a software developer can use a construct called __________.
- Avarargs
- Ban array
- Can ArrayList
- Da 2-d array
- ENone of the above
32The ternary operator takes three operands and uses the (?:) notation. What control structure does the ternary operator mimic?
- AWhile loop
- BSwitch
- CIf/else
- DFor loop
- EDo/while loop
33Which of the following is NOT valid regarding method calls in the Java programming language?
- AAll methode are automatically public so they can be called from wherever throughout a program
- BUse method name by itself to call another method of the same class
- CUse variable reference to an object followed by '.' and the method name for non-static methods
- DUse class name followed by a '.' and static method name
- EAll of the above
34Regarding object-oriented programming, declaration means that a variable name is associated with an object type and creates an abject of that type.
- ATrue
- BFalse
35When method parameters have the same name as class fields this is called __________.
- ARepetition
- BShadowing
- CDuplication
- DSame name
- EConfusion
36When having to programmatically differentiate a parameter having the same name as a field of a class what keyword can resolve this issue with the compiler when setting the field value equal to the argument value passed into the method?
- Akeyword
- Bparameter
- Cargument
- Dthis
- Ein
37Regarding object-oriented programming, when an object is instantiated the keyword new is used, memory is allocated, and a reference to that memory is returned.
- ATrue
- BFalse
38How are primitive and reference data arguments passed into a method?
- ABy value
- BBy reference
- CBy physical location
- DBy object location
- ENone of the above
39An interface can and should be instantiated.
- ATrue
- BFalse
40A method in Java can return primitive data types, __________, or ___________.
- AProject, package
- BFunction, method
- CClass, interface
- DConstructor, exception
- ECode, return
41What is used in the Java programming language to organize classes and interfaces in a logical manner?
- AObject
- BClass
- CInterface
- DPackage
- ELibrary
42When defining an interface in the object-oriented programming language Java it can comprise of which of the following ?
- AConstants
- BKeyword "interface"
- CDefault methods
- DModifiers
- EAll of the above
43The keyword this is used to reference __________.
- AThe inheritance
- BThe interface
- CThe subclass
- DThe current object
- EThe class's destructor
44An array is a container object that holds a __________ number of values of a __________ data type.
- AVariable, fixed
- BFixed, variable
- CVariable, single
- DFixed, single
- ENone of the above
45To create a static method in the Java programming language the modifier __________ must be used in the declaration.
- AFinal
- BStatic
- CVoid
- DPublic
- EPrivate
46Returning a value from a method that is declared with a return type of void results in compiler error.
- ATrue
- BFalse
47Unary operators __________.
- ARequire two or more operands
- BRequire one operand
- CAre used for incrementing/decrementing a value by one
- DRequire two or more operands AND Are used for incrementing/decrementing a value by one
- ERequire one operand AND Are used for incrementing/decrementing a value by one
48Operators are special symbols that perform specific operations on __________ operands, and return a result.
- AOne
- BOne or two
- COne, two or three
- DUnlimited
- ENone of the above
49Interfaces and abstract classes can have objects instantiated from them.
- ATrue
- BFalse
50Which of the following declares an array correctly from a syntax perspective?
- AString stringArray;
- BString[] stringArray;
- CString stringArray[];
- DString stringArray; AND String[] stringArray;
- EString[] stringArray; AND String stringArray[];
51Interfaces and abstract classes can have objects instantiated from them.
- ATrue
- BFalse
52Operators with higher precedence are evaluated ___________ operators with relatively ___________ precedence.
- ABefore, lower
- BAfter, lower
- CBefore, higher
- DAfter, higher
- ENone of the above
53Each item in an array is called an __________ and to access them programmatically user an __________.
- AData, value
- BValue, data
- CIndex, element
- DElement, index
54A class that uses an explicit constructor invocation uses the keyword this to __________
- ACall the super constructor in the same class
- BUser recursion and call itself
- CCall another constructor in the same class
- DCall another constructor in a different class
- ECall the constructor of the implemented interface
55When a method has a return type other than void what data type can be returned from that method?
- AThe returned data type must match the declared return data type
- BNo return value is required
- CThe returned data type can be any data type valid in the Java programming language
- DThe returned data type should be String
- ENone of the above
56When defining classes in the Java programming language a software developer can extend __________ supercalasses and implement _________ interfaces.
- AOne, unlimited
- BUnlimited, one
- CTwo, unlimited
- DUnlimited, two
- EUnlimited, unlimited
57Access level modifiers define how other classes can reference a field or invoke a method.
- ATrue
- BFalse
58What are the two required components of an array declaration in the Java programming language?
- ASize and data type
- BData type and []
- CName and size
- DType and name
- ESize and []
59A class that is declared final can be extended or subclassed.
- ATrue
- BFalse
60When does a method return to the code that invoked it?
- ACompletes all the statements in the method
- BReaches a return statement
- CThrows an exception
- DCompletes all the statements in the method, AND Reaches a return statement
- ECompletes all the statements in the method, AND Reaches a return statement, AND Throws an exception
61Classes that cannot have objects created from them are called what?
- AConcrete
- BInterfaces
- CInheritance
- DPolymorphism
- EAbstract
62An abstract method is a method that is:
- ADeclared without implementation
- BHas no curly braces
- CEnds with a semicolon
- DDeclared without implementation AND Has no curly braces AND Ends with a semicolon
- ENone of the above
63A subclass of an abstract class must provide __________ for all abstract methods of the superclass to be considered a concrete class.
- AInterfaces
- BImplementation
- CGuidance
- DComments
- EShadowing
64What is the automatic access modifier of methods and fields of interfaces?
- APackage
- BPackage-private
- CPrivate
- DPublic
- EProtected
65What does the keyword final indicated regarding methods or field members of a class?
- AThey are public
- BThey are private
- CThey are modifiable
- DThey cannot be modified
- ENone of the above
Information
- Description
- Engineering Quiz on COP 3330 - Exam 1, created by Stephen Bennett on 04/02/2018.
- Author
- Stephen Bennett
- Language
- English
- Views
- 0
- Tags
- Rating
- No ratings yet Rate this quiz