Docsity

COMP 308 JAVA FOR PROGRAMMERS PREPARATION GUIDE WITH TESTED QUESTIONS AND ANSWERS, Exams of Data Representation and Algorithm Design

Toggle sidebar
bg1
COMP 308 JAVA FOR PROGRAMMERS
PREPARATION GUIDE WITH TESTED QUESTIONS
AND ANSWERS
โ—‰ abstract method.
Answer: a method with a name, parameter variable types, and
return type but without an implementation
โ—‰ access specifier.
Answer: a reserved word that indicates the accessibility of a feature,
such as private or public
โ—‰ accessor method.
Answer: a method that accesses an object but does not change it
โ—‰ aggregation.
Answer: the has-a relationship between classes
โ—‰ API.
Answer: Application Programming Interface
a code library for building programs
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13

Partial preview of the text

Download COMP 308 JAVA FOR PROGRAMMERS PREPARATION GUIDE WITH TESTED QUESTIONS AND ANSWERS and more Exams Data Representation and Algorithm Design in PDF only on Docsity!

COMP 308 JAVA FOR PROGRAMMERS

PREPARATION GUIDE WITH TESTED QUESTIONS

AND ANSWERS

โ—‰ abstract method. Answer: a method with a name, parameter variable types, and return type but without an implementation โ—‰ access specifier. Answer: a reserved word that indicates the accessibility of a feature, such as private or public โ—‰ accessor method. Answer: a method that accesses an object but does not change it โ—‰ aggregation. Answer: the has-a relationship between classes โ—‰ API. Answer: Application Programming Interface a code library for building programs

โ—‰ applet. Answer: a graphical Java program that executes inside a web browser โ—‰ argument. Answer: a value supplied in a method call, or one of the values combined by an operator โ—‰ array. Answer: a collection of values of the same type which can be accessed by an integer index โ—‰ ArrayList. Answer: a Java class that implements a dynamically-growable array of objects โ—‰ assignment. Answer: placing a new value into a variable โ—‰ association.

โ—‰ block. Answer: a group of statements bracketed by {} โ—‰ body. Answer: all statements of a method or block โ—‰ Boolean operator. Answer: an operator that can be applied to Boolean values &&, ||, and! โ—‰ Boolean type. Answer: a type with two possible values: true and false โ—‰ bounds error. Answer: trying to access an array element that is outside the legal range โ—‰ break statement. Answer: a statement that terminates a loop or switch statement โ—‰ bug.

Answer: a programming error โ—‰ byte. Answer: made up of eight bits โ—‰ bytecode. Answer: instructions for the Java Virtual Machine โ—‰ call stack. Answer: the ordered set of all methods that currently have been called but not yet terminated, starting with the current method and ending with main โ—‰ callback. Answer: a mechanism for specifying a block of code so it can be executed at a later time โ—‰ cast. Answer: explicitly converting a value from one type to a different type โ—‰ CPU. Answer: central processing unit

Answer: placing one string after another to form a new string โ—‰ concrete class. Answer: a class that can be instantiated โ—‰ console program. Answer: a Java program that does not have a graphical window; reads input from the keyboard and writes output to the terminal screen โ—‰ constant. Answer: a value that cannot be changed by a program; defined with the reserved word final โ—‰ constructor. Answer: a sequence of statements for initializing a newly instantiated object โ—‰ container. Answer: a user-interface component that can hold other components and present them together to the user โ—‰ content pane.

Answer: the part of a Swing frame that holds the user-interface components of the frame โ—‰ CRC card. Answer: an index card representing a class that lists its responsibilities and collaborating classes โ—‰ debugger. Answer: a program that lets a user run another program one or a few steps at a time, stop execution, and inspect the variables in order to analyze it for bugs โ—‰ dependency. Answer: the uses relationship between classes, in which one class needs services provided by another class โ—‰ dot notation. Answer: the notation object.method(arguments) or object.variable used to invoke a method or access a variable โ—‰ doubly-linked list. Answer: a linked list in which each link has a reference to both its predecessor and successor links

Answer: Integrated Development Environment a programming environment that includes an editor, compiler, and debugger โ—‰ implementing an interface. Answer: implementing a class that defines all methods specified in the interface โ—‰ inheritance. Answer: the is-a relationship between a more general superclass and a more specialized subclass โ—‰ initialize. Answer: set a variable to a well-defined value when it is created โ—‰ instance of a class. Answer: an object whose type is that class โ—‰ instance variable. Answer: a variable defined in a class for which every object of the class has its own value

โ—‰ instantiation of a class. Answer: construction of an object of that class โ—‰ interface type. Answer: a type with no instance variables, only abstract methods and constants โ—‰ iterator. Answer: an object that can inspect all elements in a container such as a linked list โ—‰ linear search. Answer: searching a container (such as an array or list) for an object by inspecting each element in turn โ—‰ linked list. Answer: a data structure that can hold an arbitrary number of objects, each of which is stored in a link object, which contains a pointer to the next link โ—‰ local variable. Answer: a variable whose scope is a block

โ—‰ null reference. Answer: a reference that does not refer to any object โ—‰ object. Answer: a value of a class type โ—‰ object-oriented programming. Answer: designing a program by discovering objects, their properties, and their relationships โ—‰ object reference. Answer: a variable whose type is a class contains a reference to an object of that class โ—‰ overloading. Answer: giving more than one meaning to a method name โ—‰ overriding. Answer: redefining a method in a subclass โ—‰ package.

Answer: a collection of related classes; the import statement is used to access one or more classes in a package โ—‰ parameter variable. Answer: a variable of a method that is initialized with a value when the method is called โ—‰ polymorphism. Answer: selecting a method among several methods that have the same name on the basis of the actual types of the implicit parameters โ—‰ priority queue. Answer: an abstract data type that enables efficient insertion of elements and efficient removal of the smallest element โ—‰ pseudocode. Answer: a high-level description of the actions of a program or algorithm, using a mixture of English and information programming- language syntax โ—‰ public interface. Answer: the features (methods, variables, and nested types) of a class that are accessible to all clients

Answer: a word that has a special meaning in a programming language and therefore cannot be used as a name by the programmer โ—‰ return value. Answer: the value returned by a method through a return statement โ—‰ scope. Answer: the part of a program in which a variable is defined โ—‰ selection sort. Answer: a sorting algorithm in which the smallest element is repeatedly found and removed until no elements remain โ—‰ sentinel. Answer: a value in input that is not to be used as an actual input but to signal the end of input โ—‰ set. Answer: an unordered collection that allows efficient addition, location, and removal of elements โ—‰ source code.

Answer: instructions in a programming language that need to be translated before execution on a computer โ—‰ source file. Answer: a file containing instructions in a programming language such as Java โ—‰ stack. Answer: a data structure with "last-in, first-out" retrieval; elements can be added and removed only at one position, called the top of the stack โ—‰ static method. Answer: a method with no implicit parameter โ—‰ static variable. Answer: a variable defined in a class that has only one value for the whole class, and which can be accessed and changed by any method of that class โ—‰ String. Answer: a sequence of characters

โ—‰ Unified Modeling Language (UML). Answer: a notation for specifying, visualizing, constructing, and documenting the artifacts of software systems โ—‰ variable. Answer: a symbol in a program that identifies a storage location that can hold different values โ—‰ void. Answer: a reserved word indicating no type or an unknown type โ—‰ Wrapper class. Answer: a class that contains a primitive type value, such as Integer โ—‰