-
Are all object-oriented programming languages
statically typed?
Answer
-
Is a class an important concept of object-based programming?
Answer
-
In object-oriented programming language
implementations, are methods stored in objects?
Answer
-
In a single-inheritance object-oriented language, is there a limit on
the number of base classes that a class can have?
Answer
-
In a single-inheritance object-oriented language, is there a limit on
the number of subclasses that a class can have?
Answer
-
In a single-inheritance object-oriented language, is there a limit on
the number of superclasses that a class can have?
Answer
-
In object-oriented programming,
is a private variable of an object accessible only
to that one object, or is it possible for other objects to
access it directly?
Answer
-
In object-oriented programming, you imagine that
objects carry methods with them. Yet, the methods are
not really stored with the objects. How does an object
locate its methods? How does it know which methods to select?
What is the name of the system support that is responsible
for locating methods?
Answer
-
How does the mechanism for inheriting variables work in
single-inheritance object-oriented languages?
Answer
What are the characteristics of a virtual method? What makes
it virtual?
Answer
What is an abstract class?
Answer
-
What is the difference between static method
selection and dynamic method selection?
Answer
-
True or false?
-
A token can only have one associated lexeme.
Answer
A variable name is typically a single lexeme in a program.
Answer
Most programming languages have a comment token in their grammars.
Answer
Most programming languages require two consecutive lexemes to be
separated by a space or spaces.
Answer
-
What is Backus-Naur Form, and what is it used for?
Answer
-
Show a parse tree for string aacacab according to
the following grammar, where the start nonterminal is S.
In this grammar, upper case letters are nonterminals and
lower case letters are tokens.
S → F a S
| b
F → a F
| c
Answer
-
Show that the following grammar is ambiguous.
The start symbol is S.
Upper case letters are nonterminals and
lower case letters are tokens.
S → S a
| a S
| a
Answer
-
Consider the following BNF grammar.
S → a S a
S → b S b
S → c
Show that string abbcbba can be derived from
S by showing a parse tree for it.
Answer
-
Write a context-free grammar for sequences of left and right parentheses
that are balanced. A sequence of parentheses is balanced if parentheses
match and are well nested. For example, (()(())) is balanced, but
)( and ())()( are not balanced.
The grammar must derive all balanced sequences of parentheses and
must not derive any other sequences.
Answer
-
Write a context-free grammar for sequences of zero or more b's
separated by commas. For example, it should derive b,b,b,b
The grammar should not derive b,, or similar sequences that
are not zero or more b's separated by commas.
Answer