Computer Knowledge
Programming Languages and Compilers
2,284 Questions
Programming languages and compilers involve the rules, syntax, and semantics used to write and execute software programs. Key areas include scripting languages, object oriented concepts, and parsing algorithms like top down parsers. Practice these computer science questions to build proficiency for technical and computer knowledge exams.
Object oriented languagesScripting languagesCompilers and parsersProgramming syntax
Programming Languages and Compilers Questions
-
four
-
three
-
two
-
five
-
none of these
C
Correct answer
Explanation
Byte stream can be defined by using two class hierarchies. These two classes are input stream and Output stream.
-
Object Output Stream
-
Piped Output Stream
-
ByteOutputStream
-
Both 1 and 2
-
All of these
D
Correct answer
Explanation
Option 1 and 2 are the correct choices.
-
Nine
-
Eight
-
Seven
-
Six
-
Five
D
Correct answer
Explanation
There are 6 subclasses of reader Class in Java. These are 1) BufferedReader for buffering other readers 2) ChararrayReader for reading from char array 3) FilterReader for readin filter streams 4) InputStreamReader for reading a character stream 5) PipedReader for reading from pipe 6) StringReader for reading from a string.So this is the correct answer.
D
Correct answer
Explanation
This is the correct answer. Streams can be used to input and output the data. They are of two types. Byte Stream - for handling binary data. Character Stream - for handling data such as sequence of characters. Thus this is the correct answer.
-
StrBufferedInputStream
-
FilterInputStream
-
SequenceInputStream
-
Both 2 and 3
-
All of these
D
Correct answer
Explanation
This is the correct answer.
-
Nine
-
Six
-
Five
-
Eight
-
Seven
C
Correct answer
Explanation
There are five subclasses of Output Stream class.
These are
1) File Output Stream - for writing bytes into file.
2) Object Output Stream - for writing objects and primitive data types to output stream.
3) Byte Array Output Stream:- For output stream that writes byte into array.
4) piped Output Stream - for writing into a piped stream.
5) Filter Output Stream : for filtering output into an existing stream. So this is an incorrect answer.
-
seven
-
five
-
two
-
four
-
none of these
C
Correct answer
Explanation
Character stream class is defined by using two class hierarchies. These classes are Reader class and Writer class.
-
Seven
-
Six
-
Eight
-
Nine
-
Five
A
Correct answer
Explanation
There are 7 subclasses of Writer class in Java.
These are
1) OutputStreamWrite for writing a character stream
2) BufferedWriter for buffering other writers
3) PrintWriter for writing formatted data
4) PipedWriter for writing to a pipe
5) CharArrayWriter for writing to a char array
6) StringWriter for writing to a string
7) FilterWriter for writing filtered streams. So this is the correct answer.
-
Nine
-
Seven
-
Eight
-
Six
-
Five
B
Correct answer
Explanation
There are seven subclasses of InputStream class.
These are
1) FileInputStream for reading bytes from a file
2) ObjectInputStream for reading objects and primitive data types from input stream
3) SequenceInputStream for reading from a sequence of streams
4) ByteArrayInputStream for a stream that reads a byte array
5) pipedInputStream for reading from a piped stream
6) FilterInputStream for filtering input from the existing Stream
7) StringBufferInputStream for reading from a string.
-
RijndaelManaged
-
ProtectedMemory
-
Rijndael
-
RijndaelManagedTransform
-
RIPEMD160Managed
A
Correct answer
Explanation
This .NET cryptographic class accesses the managed version of the Rijndael algorithm.
-
RSAOAEPkeyExchangeDeformatter
-
RSACryptoServiceProvider
-
RSAOAEPKeyExchangeFormatter
-
ProtectedData
-
AsymmetricKeyExchangeFormatter
C
Correct answer
Explanation
This .NET cryptographic class creates optimal asymmetric encryption padding key exchange data using RSA.
-
A new color will be created.
-
runtime Exception
-
Parameters are not enough
-
Compile time error : cannot find method color
-
Compile time error : Color is Abstract cannot xreate an object.
B
Correct answer
Explanation
This is the correct answer because color constructor creates a new color but it takes parameters in the range 0-255. But here the value passed is 284 (in first parameter). So, a runtime exception named “IllegalArgumentException” will be thrown by the JVM.
B
Correct answer
Explanation
This is the correct choice because the constructor of the Font class takes three parameters:
First:: first parameter is of String type which specifies the name of the Font.
Second: second parameter is of type int which specifies the style of the font like Font.BOLD.
Third: third parameter is of type int which specifies the size of the font.
ExampleFont f1 = new Font(“Serif”, Font.BOLD, 32); So this option is true.
C
Correct answer
Explanation
This answer is correct because there are 8 primitive data types in java. These are ByteShortIntLongDoubleCharFloatBoolean.
-
A posing class can call overridden methods through super keyword.
-
The posing class must not define any new instance variables other than target class.
-
A posing class can not override methods defined in the categories.
-
The target class is unaware of any information about posing class.
-
A class may only pose as one of its direct or indirect super classes.
C
Correct answer
Explanation
A posing class can override methods defined in categories.