Test
Programming
Crea una cuenta gratis para terminar este test
Guarda tu progreso y consulta tu resultado final.
¿Ya tienes cuenta? Inicia sesión
Preguntas del test (46)
1Which of the following is used in VB to represent a non-existent object?
- ANothing
- BNull
- CEmpty
- DShared
2What is similar to a function?
- AReadOnly Properties
- BWriteOnly Properties
- CPublic Instance Variables
- DNone
3What is NOT correct about classes? A class is a:
- ASubset of an object
- BGeneralisation of an object
- CTemplate for further objects
4Which one of the following statements best describes a class?
- Ais a group of methods, properties and namespaces that can be manufactured from an external constructor object.
- Bis a constructor that may be used to create new objects.
- Cdescribes any number of objects that can be manufactured from it using the 'New' keyword.
- Dis manufactured from an object using the 'New' keyword.
5A class is being written to represent a car in a VB program. Which one of the following would be the most suitable name for a property for this class?
- AEngineSize
- BracingCar
- CDrive_Forward
- DVehicles
6Which one of the following describes the OOP practice of bundling data and actions together in objects so that not all method and properties are directly accesible by the outside world?
- AInheritance
- BPackaging
- CPolymorphism
- DEncapsulation
7Which one of the following is the correct definition of ADT?
- AAbstract Data Type
- BAtomic Database Transaction
- CAutomated Data Typing
- DAbstract Data Transaction
8Which one of the following statements describes what happens when an object is destroyed?
When an object is destroyed, the memory that was used to store the values of its variables is:- Areclaimed for other uses by the run-time system
- Blocked and cannot be re-allocated until the system is restarted
- Creserved by the run-time system until the program terminates
- Dzeroed-out by the operating system
9Which one of the following is similar to a function?
- ANone of the other options are similar to a function
- BReadOnly properties
- CWriteOnly properties
- DPublic instance variables
10Which one of the following keywords can be used in a variable declaration to specify that it should be accessible by subclasses but not by other classes?
- AFriend
- BProtected
- CPrivate
- DPublic
11Which one of the following keywords declares that a class does not exist as a full class but is provided to be used for inheritance only?
- AMustInherit
- BADT
- CMustOverride
- DAbstract
12Which one of the following statements about the 'MyBase' keyword is NOT correct?
- AMyBase can be used by a class to call methods in its immediate superclass or one of the classes further up the tree
- BCalls to a superclass' constructor using MyBase cannot be made from the first line of a subclass' 'New' method.
- CUsing MyBase can help reduce code duplication and make a program more concise by making the maximum use of existing methods.
- DMyBase can be used to distinguish calls to methods in a superclass from calls to methods in the same class
13Which one of the following is possible with inheritance, but is considered to be bad practice?
- ADeclaring variables in a subclass that overload variables in a superclass
- BDeclaring methods in a subclass that override methods in a superclass.
- CAdding additional variables to subclass
- DDeclaring variables in a subclass that override variables in a superclass
14Which one of the following statements is correct?
Classes may:- Aonly inherit from one superclass
- Bonly inherit from one subclass
- Cinherit from many subclasses
- Dinherit from many superclasses
15Which one of the following statements is NOT correct
- AComposition is often used as an alternative to inheritance
- BTime to write and test program code is reduced by extending existing classes
- CProgrammers can create classes that inherit from classes in the .Net Framework
- DInheritance eliminates the need for programmers to test their programs
16Which one of the following method types is not inherited by classes from their parent class?
- AAbstract methods
- BMethods declared as 'Protected'.
- CConstructor methods
- DMethods declared as 'Shared'
17Which one of the following is NOT a property of the ListBox class?
- AItems
- BSelectedItem
- CSelectedIndex
- DCount
18Which one of the following statements about list boxes is NOT correct?
- ANew items added to a list box are always shown at the end of the list.
- BA list control displays a list of string items in a box.
- CList box controls can be added to forms from the toolbox
- DEach list item occupies a single line in a list box.
19Which one of the following methods appends new items to a list box?
- AListBox.Items.Add
- BListBox.Append
- CListBox.Items.Append
- DListBox.Add
20Which one of the following functions returns the index of the last element in an array?
- AUpperBound
- BUBound
- CLastIndex
- DLength
21Which one of the following terms is used to describe a value stored at a specific index of an array?
- AItem
- BVariable
- CCompartment
- DElement
22Which one of the following has the same meaning as 'index' when referring to arrays?
- ASubscript
- BComponent
- CRowIndex
- DCompartment
23Which one of the following lines of code resizes an array called flightInfo without losing existing values stored in the array?
- AReDim Preserve flightInfo(45, 4) As String
- BReDim Conserve flightInfo(45, 4)
- CDim Preserve flightInfo(45, 4)
- DReDim Conserve flightInfo(45, 4) As String
- EReDim Preserve flightInfo(45, 4)
24Look at the following line of VB program code:
Dim info(3, 3) As Integer
Which one of the following describes the 'info' variable?- AA two dimensional array of Integers.
- BA three dimensional array of Integers.
- CA single Integer variable
- DA single dimensional array of Integers
25Which one of the following statements is correct?
When redimensioning arrays with 2 dimensions:- Aneither dimension can be changed
- Bonly the first dimension can be changed
- Cboth dimensions can be changed
- Donly the last (second) dimension can be changed
26Which one of the following punctuation marks is NOT essential when writing a line of code that declares an array and initializes it with some values?
- Adot (.)
- Bcurly brackets { }
- Cbrackets ( )
- Dcomma (,)
27Which one of the following can be used in an array declaration to clarify the purpose of each dimension?
- AConstants
- BFor loops
- CIndices
- DBounds
28Look at the following lines of VB program code:
Dim rawString As String = " Some message to show "
Dim tidyString = rawString.Trim.ToLower
Which one of the following will be the value of tidyString once this code has been executed?- A"some message to show "
- B" Some message to show"
- C"some message to show"
- D"somemessagetoshow"
29Which one of the following functions might be used to check whether a string can be converted to an Integer using CInt?
- AHasDecimalPart
- BIsInteger
- CIsInterned
- DIsNumeric
30Which one of the following is NOT a string function?
- ASplit
- BRemove
- CInsert
- DSubstring
- EFirstIndexOf
31Look at the following VB program code:
Dim rawString As String
Dim parts() As String
rawString = "2+3+4+5=14"
parts = rawString.Split("+")
TextBox1.Text = parts(1)
Which one of the following will be displayed in TextBox1 when this code is executed?- A2
- B2+
- C3
- D3+
- E+3
32In which one of the following situations are strings NOT used?
- ADisplaying messages on the screen.
- BUsers entering text from a keyboard prompt.
- CStrings are used in all of these situations.
- DHolding text in memory for word-processors and editors.
- ESearching web pages.
33Is the following statement true or false?
Exceptions must be caught and handled within the same method that they were raised.- AVerdadero
- BFalso
34Which one of the following classes do all exceptions inherit from?
- AException
- BCoreException
- CSystemException
- DExceptionBase
35Which one of the following keywords is used to create a new exception?
- AThrow
- BRaiseError
- CRaiseEvent
- DTry
36Which one of the following statements about Catch blocks is correct?
- AMore specific catch blocks must be above the more general cases
- BOnly one catch block may be specified in each Try block.
- CMore general catch blocks must be above the more specific cases.
- DMultiple catch statements can be executed within a single Try block
37Which one of the following statements about exceptions is NOT correct?
- AMethod execution is abandoned when a new exception is thown
- BExceptions change the order in which statements are obeyed, so they are a form of control structure.
- CGenerally, it is good practice to catch and handle exceptions at the top-most level of code
- DExceptions should not be used for normal cases
38Which one of the following classes in the .Net Framework can be used to contain and display a number of menu options on a form?
- AMenuOptions
- BTopLevelMenu
- CMenuStrip
- DMenuItem
39Which one of the following methods of the System.IO.Directory class returns an array of the names of all directories AND their sub directories within a top-level directory?
- AGetDirectoryTree
- BGetDirectories
- CGetFiles
- DNone of the above
40Which one of the following classes provided by the .Net framework can be used to display an 'Open' file dialog to users?
- AFileOpenDialog
- BOpenFileDialog
- CFileDialog
- DShowDialog
41Which one of the following keywords can be used when writing data to a file to ensure that the file is closed if an error occurs?
- AUsing
- BHandles
- CException
- DAlwaysClose
42Which of one the following statements about functions is NOT correct?
- AFunctions can contain the 'Return' keyword more than once
- BFunction parameters can only be 'ByVal'
- CFunctions return a value
- DFunctions can return nothing
43Which one of the following does the 'Me' keyword refer to?
- AThe username of the current user
- BThe current method
- CThe control currently selected on a form
- DThe current object
44Which one of the following describes the difference between a Sub and a Function?
- ASubs cannot be event handlers
- BFunctions cannot return value types
- CSubs cannot be overloaded
- DSubs cannot return objects
45Which one of the following is NOT a purpose of methods?
- ARemoving duplication
- BHiding complexity
- CAllowing programmers to 'think at a higher level'
- DIsolating flexibility
46Which one of the following statements about method arguments is NOT correct?
- AArguments must be the correct type
- BArguments may be expressions
- CArguments may be object or value types
- DArguments may be in any order
Información
- Descripción
- Test sobre Programming, creado por Harkaran Matharu el 18/05/2018.
- Autor
- Harkaran Matharu
- Idioma
- English
- Visitas
- 0
- Valoración
- Aún sin valoraciones Valora este test