Appl Itude
Appl Itude
Appl Itude
a) -128 to 127
b) -32768 to 32767
c) -2147483648 to 2147483647
d) None of the mentioned
Answer:b
Explanation:Short occupies 16 bits in memory. Its range is from -32768 to 32767.
2. Which of these coding types is used for data type characters in Java?
a) ASCII
b) ISO-LATIN-1
c) UNICODE
d) None of the mentioned
Answer:c
Explanation: Unicode defines fully international character set that can represent all the
characters found in all human languages. Its range is from 0 to 65536.
Answer:c
Explanation:Operator new allocates block of memory specified by the size of array, and gives
the reference of memory allocated to the array variable.
a) 0
b) 1
c) 3
d) -4
9. What is the stored in the object obj in following lines of code?
box obj;
a) Memory address of allocated memory of object.
b) NULL
c) Any arbitrary pointer
d) Garbage
Answer: b
Explanation: Memory is allocated to an object using new operator. box obj; just declares a
reference to object, no memory is allocated to it hence it points to NULL.
11. Which function is used to perform some action when the object is to be
destroyed?
a) finalize()
b) delete()
c) main()
d) None of the mentioned
12. Which of the folowing stements are incorrect?
a) Default constructor is called at the time of declaration of the object if a constructor
has not been defined.
b) Constructor can be parameterized.
c) finalize() method is called when a object goes out of scope and is no longer
needed.
d) finalize() method must be declared protected.
Answer: c
Explanation: finalize() method is called just prior to garbage collection. it is not called when
object goes out of scope.
14. A class member declared protected becomes member of subclass of which type?
a) public member
b) private member
c) protected member
d) static member
Answer: b
Explanation: A class member declared protected becomes private member of subclass.
System.out.println(i);
}
}
class B extends A {
int j;
void display() {
System.out.println(j);
}
}
class inheritance_demo {
public static void main(String args[])
{
B obj = new B();
obj.i=1;
obj.j=2;
obj.display();
}
}
a) 0
b) 1
c) 2
d) Compilation Error
Answer: c
Explanation: class A & class B both contain display() method, class B inherits class A, when
display() method is called by object of class B, display() method of class B is executed rather
than that of Class A.
17. Which of these method of class String is used to obtain length of String object?
a) get()
b) Sizeof()
c) lengthof()
d) length()
Answer: c
a) ABC
b) BCD
c) CDA
d) ABCD
Answer: b
Explanation: ascii is an array of integers which contains ascii codes of Characters A, B, C, D.
String(ascii, 1, 3) is an constructor which initializes s with Characters corresponding to ascii
codes stored in array ascii, starting position being given by 1 & ending position by 3, Thus s
stores BCD.
output:
$ javac String_demo.java
$ java String_demo
BCD
21. Which of these method of class StringBuffer is used to get the length of
sequence of characters?
a) length()
b) capacity()
c) Length()
d) Capacity()
Answer: a
Explanation: length()- returns the length of String the StringBuffer would create whereas
capacity() returns total number of characters that can be supported before it is grown.
22.What will be the output of following
class output {
public static void main(String args[])
{
StringBuffer c = new StringBuffer("Hello");
System.out.println(c.length());
}
}
a) 4
b) 5
c) 6
d) 7
Explanation: length() method is used to obtain length of StringBuffer object, length of Hello
is 5.
Output:
$ javac output.java
$ java output
5
24. Which of these method of Thread class is used to find out the priority given to a
thread?
a) get()
b) ThreadPriority()
c) getPriority()
d) getThreadPriority()
Answer: c
Explanation: None.
25. Which function of pre defined class Thread is used to check weather current
thread being checked is still running?
a) isAlive()
b) Join()
c) isRunning()
d) Alive()
Answer:a
Explanation:isAlive() function is defined in class Thread, it is used for implementing
multithreading and to check whether the thread called
upon is still running or no
a) main
b) Thread
c) New Thread
d) Thread[New Thread,5,main]
Answer: c
Explanation: The getName() function is used to obtain the name of the thread, in this code the
name given to thread is New Thread.
Output:
$ javac multithreaded_programing.java
$ java multithreaded_programing
New Thread
29. Which of these keywords is used to by the calling function to guard against the
exception that is thrown by called function?
a) try
b) throw
c) throws
d) catch
a) A
b) B
c) Hello
d) Runtime Error
31.Which of these functions is called to display the output of an applet?
a) display()
b) print()
c) displayApplet()
d) PrintApplet()
Answer: b
Explanation: Whenever the applet requires to redraw its output, it is done by using method
paint().
32. What is the Message is displayed in the applet made by this program?
import java.awt.*;
import java.applet.*;
public class myapplet extends Applet {
public void paint(Graphics g) {
g.drawString("A Simple Applet", 20, 20);
}
}
a) A Simple Applet
b) A Simple Applet 20 20
c) Compilation Error
d) Runtime Erro
Answer: a
Explanation: None.
Output:
A Simple Applet
(Output comes in a new java application)
33. Which of these is used to perform all input & output operations in Java?
a) streams
b) Variables
c) classes
d) Methods
Answer: a
Explanation: Like in any other language, streams are used for input and output operations.
34. Which of these classes are used by Byte streams for input and output operation?
a) InputStream
b) InputOutputStream
c) Reader
d) All of the mentioned
Answer: a
Explanation: Byte stream uses InputStream and OutputStream classes for input and output
operation.
a) abcqfgh
b) abc
c) abcq
d) abcqfghq
Answer: c
Explanation: None.
Output:
$ javac Input_Output.java
$ java Input_Output
abcq
36. Which of these class object can be used to form a dynamic array?
a) ArrayList
b) Map
c) Vector
d) ArrayList & Map
Answer: d
Explanation: Vectors are dynamic arrays, it contains many legacy methods that are not part
of collection framework, and hence these methods are not present in ArrayList. But both are
used to form dynamic arrays.
37. What is the name of data member of class Vector which is used to store number
of elements in the vector?
a) length
b) elements
c) elementCount
d) capacity
Answer: c
Explanation: None.
a) 2
b) 3
c) 4
d) 6
Answer: c
Explanation: None.
Output:
$ javac vector.java
$ java vector
4
Answer: b
Explanation: None.
instructions.
42. To overcome the problems of the assembler in dealing with branching code we
use _____ .
a) Interpreter
b) Debugger
c) Op-Assembler
d) Two-pass assembler
Answer:d
Explanation: This creates entries into the symbol table first and then creates the object
code.
43 . The assembler stores all the names and their corresponding values in ______ .
a) Special purpose Register
b) Symbol Table
c) Value map Set
d) None of the above
Explanation: The table where the assembler stores the variable names along with their
Pass 1
Pass 2
not evaluated by the assembler
None of above
Ans-A
45) Which of the following system software resides in the main memory
always ?
a.
b.
c.
d.
Text editor
Assembler
Linker
Loader
Ans_D
46) Parsing is also known as ?
a.
b.
c.
d.
Lexical analysis
Syntax analysis
Semantic analysis
Code generation
Ans.A
48) Bottom up parsing involves ?
a.
b.
c.
d.
Shift reduce
Handle pruning
Operator check
A and B
Answer = D
3) The linker ?
a.
49) In a two pass assembler the object code generation is done during the ?
a.
b.
c.
d.
Second pass
First pass
Zeroeth pass
Not done by assembler
Ans.A.
50.compiler for a high level language that runs on one machine and produce code for
different machine is called
a.
b.
c.
d.
Optimizing compiler
One pass compiler
Cross compiler
Multipass compiler
Ans.C
4) Which of the following is not a type of assembler ?
a.
b.
c.
d.
one pass
two pass
three pass
Non of Above
Ans-C
Tokens
Expression
C statement
Rules
Answer = C
Ans.C.
7
6
8
None of above
2. Which of these is a mechanism for naming and visibility control of a class and its
content?
a) Object
b) Packages
c) Interfaces
d) None of the Mentioned.
Answer: b
Explanation: Packages are both naming and visibility control mechanism. We can define a
class inside a package which is not accessible by code outside the package.
3. Which of this access specifies can be used for a class so that its members can be
accessed by a different class in the same package?
a) Public
b) Protected
c) No Modifier
d) All of the mentioned
Answer: d
Explanation: Either we can use public, protected or we can name the class without any
specifier.
4. Which of these access specifiers can be used for a class so that its
members can be accessed by a different class in the different package?
a) Public
b) Protected
c) Private
d) No Modifier
View Answer
Answer: a
Explanation: None.
package pkg;
class display {
int x;
void show() {
if (x > 1)
System.out.print(x + " ");
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
}
}
class packages {
public static void main(String args[]) {
display[] arr=new display[3];
for(int i=0;i<3;i++)
arr[i]=new display();
arr[0].x = 0;
arr[1].x = 1;
arr[2].x = 2;
for (int i = 0; i < 3; ++i)
arr[i].show();
}
}
package pkg;
class output {
public static void main(String args[])
{
StringBuffer s1 = new StringBuffer("Hello");
s1.setCharAt(1, x);
System.out.println(s1);
}
}
advertisements
a) xello
b) xxxxx
c) Hxllo
d) Hexlo
View Answer
Answer: c
Explanation: None.
Output:
$ javac output.java
$ java output
Hxllo
package pkg;
class output {
public static void main(String args[])
{
StringBuffer s1 = new StringBuffer("Hello World");
s1.insert(6 , "Good ");
System.out.println(s1);
}
}
Answer: a
Explanation: None.
class Output {
public static void main(String args[]) {
char a[] = {'a', '5', 'A', ' '};
System.out.print(Character.isDigit(a[0]) + " ");
System.out.print(Character.isWhitespace(a[3]) + " ");
System.out.print(Character.isUpperCase(a[2]));
}
}
advertisements
a) true false true
b) false true true
c) true true false
d) false false false
View Answer
Answer: b
Explanation: Character.isDigit(a[0]) checks for a[0], whether it is a digit or not, since a[0] i:e
a is a character false is returned. a[3] is a whitespace hence Character.isWhitespace(a[3])
returns a true. a[2] is an upper case letter i:e A hence Character.isUpperCase(a[2]) returns
true.
Output:
$ javac Output.java
$ java Output
false true true
class Output {
public static void main(String args[]) {
Integer i = new Integer(257);
byte x = i.byteValue();
System.out.print(x);
}
}
a) 0
b) 1
c) 256
d) 257
View Answer
Answer: b
Explanation: i.byteValue() method returns the value of wrapper i as a byte value. i is 257,
range of byte is 256 therefore i value exceeds byte range by 1 hence 1 is returned and
stored in x.
Output:
$ javac Output.java
$ java Output
1
class Output {
public static void main(String args[]) {
Integer i = new Integer(257);
float x = i.floatValue();
System.out.print(x);
}
}
advertisements
a) 0
b) 1
c) 257
d) 257.0
View Answer
Answer: d
Explanation: None.
Output:
$ javac Output.java
$ java Output
257.0
class Output {
public static void main(String args[]) {
Long i = new Long(256);
System.out.print(i.hashCode());
}
}
a) 256
b) 256.0
c) 256.00
d) 257.00
View Answer
Answer: a
Explanation: None.
Output:
$ javac Output.java
$ java Output
256
2. Which of these class is related to all the exceptions that can be caught
by using catch?
a) Error
b) Exception
c) RuntimeExecption
d) All of the mentioned
View Answer
Answer: b
Explanation: Error class is related to java run time error that cant be caught usually,
RuntimeExecption is subclass of Exception class which contains all the exceptions that can
be caught.
c) RuntimeExecption
d) All of the mentioned
View Answer
Answer: a
Explanation: Error class is related to java run time error that cant be caught usually,
RuntimeExecption is subclass of Exception class which contains all the exceptions that can
be caught.
class exception_handling {
public static void main(String args[]) {
try {
System.out.print("Hello" + " " + 1 / 0);
}
finally {
System.out.print("World");
}
}
}
advertisements
a) Hello
b) World
c) Compilation Error
class exception_handling {
public static void main(String args[]) {
try {
int a, b;
b = 0;
a = 5 / b;
System.out.print("A");
}
catch(ArithmeticException e) {
System.out.print("B");
}
}
}
a) A
b) B
c) Compilation Error
d) Runtime Error
View Answer
Answer: b
Explanation: None.
Output:
$ javac exception_handling.java
$ java exception_handling
B
class exception_handling {
public static void main(String args[]) {
try {
int a[] = {1, 2,3 , 4, 5};
for (int i = 0; i < 7; ++i)
6.
7.
8.
9.
10.
11.
12.
System.out.print(a[i]);
}
catch(ArrayIndexOutOfBoundsException e) {
System.out.print("0");
}
}
}
a) 12345
b) 123450
c) 1234500
d) Compilation Error
View Answer
Answer: b
Explanation: When array index goes out of bound then ArrayIndexOutOfBoundsException
exceptio is thrown by the system.
Output:
$ javac exception_handling.java
$ java exception_handling
123450
advertisements
9. What is the output of this program?
1.
class exception_handling {
2.
public static void main(String args[]) {
3.
try {
4.
int i, sum;
5.
sum = 10;
6.
for (i = -1; i < 3 ;++i)
7.
sum = (sum / i);
8.
}
9.
catch(ArithmeticException e) {
10.
System.out.print("0");
11.
}
12.
System.out.print(sum);
13.
}
14.
}
a) 0
b) 05
c) Compilation Error
d) Runtime Error
View Answer
Answer: c
Explanation: Since sum is declared inside try block and we are trying to access it outside the
try block it results in error.
Output:
$ javac exception_handling.java
Exception in thread main java.lang.Error: Unresolved compilation problem:
sum cannot be resolved to a variable
class exception_handling {
public static void main(String args[]) {
try {
int a[] = {1, 2,3 , 4, 5};
for (int i = 0; i < 5; ++i)
System.out.print(a[i]);
int x = 1/0;
}
catch(ArrayIndexOutOfBoundsException e) {
System.out.print("A");
}
catch(ArithmeticException e) {
System.out.print("B");
}
}
}
a) 12345
b) 12345A
c) 12345B
d) Comiplation Error
View Answer
Answer: c
Explanation: There can be more than one catch for a single try block. Here Arithmetic
exception(/ by 0) occurs instead of Array index out of bound exception, so 2nd catch block is
executed.
Output:
$ javac exception_handling.java
$ java exception_handling
12345B
Answer: a
Explanation: Java assigns to each thread a priority that determines hoe that thread should
be treated with respect to others. Thread priority are integers that specify relative priority of
one thread to another.
class multithreaded_programing {
public static void main(String args[]) {
Thread t = Thread.currentThread();
System.out.println(t);
}
}
advertisements
a) Thread[5,main] b) Thread[main,5] c) Thread[main,0] d) Thread[main,5,main] View Answer
class multithreaded_programing {
public static void main(String args[]) {
Thread t = Thread.currentThread();
System.out.println(t);
5.
6.
}
}
a) 4
b) 5
c) 0
d) 1
View Answer
Answer: b
Explanation: The output of program is Thread[main,5,main], in this priority assigned to the
thread is 5. Its the default value. Since we have not named the thread they are named by the
group to they belong i:e main method.
Output:
$ javac multithreaded_programing.java
$ java multithreaded_programing
Thread[main,5,main]
class multithreaded_programing {
public static void main(String args[]) {
Thread t = Thread.currentThread();
System.out.println(t);
}
}
advertisements
a) main
b) Thread
c) System
d) None of the mentioned
View Answer
Answer: a
Explanation: The output of program is Thread[main,5,main], Since we have not explicitly
named the thread they are named by the group to they belong i:e main method. Hence they
are named main.
Output:
$ javac multithreaded_programing.java
$ java multithreaded_programing
Thread[main,5,main]
class multithreaded_programing {
public static void main(String args[]) {
Thread t = Thread.currentThread();
System.out.println(t.isAlive());
5.
6.
}
}
a) 0
b) 1
c) true
d) false
View Answer
Answer: a
Explanation: Thread t is seeded to currently program, hence when you run the program the
thread becomes active & code t.isAlive returns true.
Output:
$ javac multithreaded_programing.java
$ java multithreaded_programing
true
6. Which of these operators can be used to get run time information about
an object?
a) getInfo
b) Info
c) instanceof
d) getinfoof
View Answer
Answer: c
Explanation: None.
1.
2.
3.
4.
5.
6.
7.
import java.awt.*;
import java.applet.*;
public class myapplet extends Applet {
public void paint(Graphics g) {
g.drawString("A Simple Applet", 20, 20);
}
}
advertisements
a) A Simple Applet
b) A Simple Applet 20 20
c) Compilation Error
d) Runtime Error
View Answer
Answer: a
Explanation: None.
Output:
A Simple Applet
(Output comes in a new java application)
import java.awt.*;
import java.applet.*;
public class myapplet extends Applet {
public void paint(Graphics g) {
g.drawString("A Simple Applet", 20, 20);
}
}
a) 20
b) 50
c) 100
d) System dependent
View Answer
Answer: a
Explanation: the code in pain() method g.drawString(A Simple Applet,20,20); draws a
applet box of length 20 and width 20.
import java.awt.*;
import java.applet.*;
public class myapplet extends Applet {
Graphic g;
g.drawString("A Simple Applet", 20, 20);
}
advertisements
a) 20
b) Default value
c) Compilation Error
d) Runtime Error
View Answer
Answer: c
Explanation: To implement the method drawString we need first need to define abstract
method of AWT that is paint() method. Without paint() method we can not define and use
drawString or any Graphic class methods.
import java.io.*;
class Chararrayinput {
public static void main(String[] args) {
String obj = "abcdefgh";
int length = obj.length();
char c[] = new char[length];
obj.getChars(0, length, c, 0);
CharArrayReader input1 = new CharArrayReader(c);
CharArrayReader input2 = new CharArrayReader(c, 1, 4);
int i;
int j;
try {
while((i = input1.read()) == (j = input2.read())) {
System.out.print((char)i);
}
}
catch (IOException e) {
e.printStackTrace();
}
}
}
a) abc
b) abcd
c) abcde
d) None of the mentioned
View Answer
Answer: d
Explanation: No output is printed. CharArrayReader object input1 contains string abcdefgh
whereas object input2 contains string bcde, when
while((i=input1.read())==(j=input2.read())) is executed the starting character of each object is
compared since they are unequal control comes out of loop and nothing is printed on the
screen.
Output:
$ javac Chararrayinput.java
$ java Chararrayinput
c) -1
d) Null
View Answer
Answer: c
Explanation: Each time read() is called, it reads a single byte from the file and returns the
byte as an integer value. read() returns -1 when the end of the file is encountered.
5. Which of these exception is thrown by close() and read() methods?
a) IOException
b) FileException
c) FileNotFoundException
d) FileInputOutputException
View Answer
Answer: a
Explanation: Both close() and read() method throw IOException.
6. Which of these methods is used to write() into a file?
a) put()
b) putFile()
c) write()
d) writeFile()
View Answer
Answer: c
Explanation: None.
7. What is the output of this program?
1.
2.
3.
4.
import java.io.*;
class filesinputoutput {
public static void main(String args[]) {
InputStream obj = new
FileInputStream("inputoutput.java");
5.
System.out.print(obj.available());
6.
}
7.
}
advertisements
Note: inputoutput.java is stored in the disk.
a) true
b) false
c) prints number of bytes in file
d) prints number of characters in the file
View Answer
8. What is the output of this program?
1.
2.
3.
4.
5.
6.
import java.io.*;
public class filesinputoutput {
public static void main(String[] args) {
String obj = "abc";
byte b[] = obj.getBytes();
ByteArrayInputStream obj1 = new
ByteArrayInputStream(b);
7.
for (int i = 0; i < 2; ++ i) {
8.
int c;
9.
while((c = obj1.read()) != -1) {
10.
if(i == 0) {
11.
System.out.print(Character.toUpperCase((char)c));
12.
obj2.write(1);
13.
}
14.
}
15.
System.out.print(obj2);
16.
}
17.
}
18.
}
a) AaBaCa
b) ABCaaa
c) AaaBaaCaa
d) AaBaaCaaa
View Answer
Answer: d
Explanation: None.
Output:
$ javac filesinputoutput.java
$ java filesinputoutput
AaBaaCaaa
9. What is the output of this program?
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
import java.io.*;
class Chararrayinput {
public static void main(String[] args) {
String obj = "abcdef";
int length = obj.length();
char c[] = new char[length];
obj.getChars(0, length, c, 0);
CharArrayReader input1 = new CharArrayReader(c);
CharArrayReader input2 = new CharArrayReader(c, 0, 3);
int i;
try {
while((i = input2.read()) != -1) {
System.out.print((char)i);
}
}
catch (IOException e) {
e.printStackTrace();
18.
19.
20.
advertisements
a) abc
b) abcd
c) abcde
d) abcdef
View Answer
Answer: a
Explanation: None.
Output:
$ javac Chararrayinput.java
$ java Chararrayinput
abc
10. What is the output of this program?
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
import java.io.*;
class Chararrayinput {
public static void main(String[] args) {
String obj = "abcdefgh";
int length = obj.length();
char c[] = new char[length];
obj.getChars(0, length, c, 0);
CharArrayReader input1 = new CharArrayReader(c);
CharArrayReader input2 = new CharArrayReader(c, 1, 4);
int i;
int j;
try {
while((i = input1.read()) == (j = input2.read()))
{
14.
15.
16.
17.
18.
19.
20.
21.
System.out.print((char)i);
}
}
catch (IOException e) {
e.printStackTrace();
}
a) abc
b) abcd
c) abcde
d) None of the mentioned
View Answer
Answer: d
Explanation: No output is printed. CharArrayReader object input1 contains string
abcdefgh whereas object input2 contains string bcde, when
while((i=input1.read())==(j=input2.read())) is executed the starting character of each
object is compared since they are unequal control comes out of loop and nothing is
printed on the screen.
Output:
$ javac Chararrayinput.java
$ java Chararrayinput
Operating System
.What is operating system?
a) collection of programs that manages hardware resources
b) system service provider to the application programs
c) link to interface the hardware and application programs
d) all of the mentioned
View Answer
Answer:d
Explanation:None.
2. To access the services of operating system, the interface is provided by the
a) system calls
b) API
c) library
d) assembly instructions
View Answer
Answer:a
Explanation:None.
3. Which one of the following is not true?
a) kernel is the program that constitutes the central core of the operating system
b) kernel is the first part of operating system to load into memory during booting
c) kernel is made of various modules which can not be loaded in running operating
system
d) kernel remains in the memory during the entire computer session
View Answer
Answer:c
Explanation:None.
4. Which one of the following error will be handle by the operating system?
a) power failure
b) lack of paper in printer
c) connection failure in the network
d) all of the mentioned
View Answer
Answer:d
Explanation:None.
advertisements
5. The main function of the command interpreter is
a) to get and execute the next user-specified command
Answer: a
Explanation: None.
9) The objective of multi-programming is to : (choose two)
a) Have some process running at all times
b) Have multiple programs waiting in a queue ready to run
c) To minimize CPU utilization
d) To maximize CPU utilization
View Answer
Answer: a and d
Explanation: None.
d) None of these
View Answer
Answer: b
Explanation: None.
9) In the Zero capacity queue : (choose two)
a) the queue has zero capacity
b) the sender blocks until the receiver receives the message
c) the sender keeps sending and the messages dont wait in the queue
d) the queue can store atleast one message
View Answer
Answer: a and b
Explanation: None.
advertisements
10) The Zero Capacity queue :
a) is referred to as a message system with buffering
b) is referred to as a message system with no buffering
c) is referred to as a link
d) None of these
View Answer
Answer: b
Explanation: None.
11) Bounded capacity and Unbounded capacity queues are referred to as :
a) Programmed buffering
b) Automatic buffering
c) User defined buffering
d) No buffering
View Answer
Answer: b
Explanation: None.
1. Which module gives control of the CPU to the process selected by the short-term
scheduler?
a) dispatcher
b) interrupt
c) scheduler
d) none of the mentioned
View Answer
Answer:a
Explanation:None.
2. The processes that are residing in main memory and are ready and waiting to execute
are kept on a list called
a) job queue
b) ready queue
c) execution queue
d) process queue
View Answer
Answer:b
Explanation:None.
3. The interval from the time of submission of a process to the time of completion is
termed as
a) waiting time
b) turnaround time
c) response time
d) throughput
View Answer
Answer:b
Explanation:None.
4. Which scheduling algorithm allocates the CPU first to the process that requests the
CPU first?
a) first-come, first-served scheduling
b) shortest job scheduling
c) priority scheduling
d) none of the mentioned
View Answer
Answer:a
Explanation:None.
advertisements
5. In priority scheduling algorithm
a) CPU is allocated to the process with highest priority
b) CPU is allocated to the process with lowest priority
c) equal priority processes can not be scheduled
d) none of the mentioned
View Answer
Answer:a
Explanation:None.
6. In priority scheduling algorithm, when a process arrives at the ready queue, its priority
is compared with the priority of
a) all process
b) currently running process
c) parent process
d) init process
View Answer
Answer:b
Explanation:None.
7. Time quantum is defined in
a) shortest job scheduling algorithm
b) round robin scheduling algorithm
c) priority scheduling algorithm
d) multilevel queue scheduling algorithm
View Answer
Answer:b
Explanation:None.
8. Process are classified into different groups in
a) shortest job scheduling algorithm
b) round robin scheduling algorithm
c) priority scheduling algorithm
d) multilevel queue scheduling algorithm
View Answer
Answer:d
Explanation:None.
advertisements
9. In multilevel feedback scheduling algorithm
a) a process can move to a different classified ready queue
b) classification of ready queue is permanent
c) processes are not classified into groups
d) none of the mentioned
View Answer
Answer:a
Explanation:None.
10. Which one of the following can not be scheduled by the kernel?
a) kernel level thread
b) user level thread
c) process
d) none of the mentioned
View Answer
Answer:b
Explanation:User level threads are managed by thread library and the kernel in unaware
of them.
advertisements
5. Which one of the following is the deadlock avoidance algorithm?
a) bankers algorithm
b) round-robin algorithm
c) elevator algorithm
d) karns algorithm
View Answer
Answer:a
Explanation:None.
6. What is the drawback of bankers algorithm?
a) in advance processes rarely know that how much resource they will need
b) the number of processes changes as time progresses
c) resource once available can disappear
d) all of the mentioned
View Answer
Answer:d
Explanation:None.
7. For effective operating system, when to check for deadlock?
a) every time a resource request is made
b) at fixed time intervals
c) both (a) and (b)
d) none of the mentioned
View Answer
Answer:c
Explanation:None.
8. A problem encountered in multitasking when a process is perpetually denied necessary
resources is called
a) deadlock
b) starvation
c) inversion
d) aging
View Answer
Answer:b
Explanation:None.
advertisements
9. Which one of the following is a visual ( mathematical ) way to determine the deadlock
occurrence?
a) resource allocation graph
b) starvation graph
c) inversion graph
4) For a deadlock to arise, which of the following conditions must hold simultaneously ?
( choose all that apply )
a) Mutual exclusion
b) Starvation
c) Hold and wait
d) No preemption
e) Circular wait
View Answer
Answer: a, c, d and e
Explanation: None.
advertisements
5) For Mutual exclusion to prevail in the system :
a) at least one resource must be held in a non sharable mode
b) the processor must be a uniprocessor rather than a multiprocessor
c) there must be at least one resource in a sharable mode
d) All of these
View Answer
Answer: a
Explanation: If another process requests that resource (non shareable resource), the
requesting process must be delayed until the resource has been released.
6) For a Hold and wait condition to prevail :
a) A process must be not be holding a resource, but waiting for one to be freed, and then
request to acquire it
b) A process must be holding at least one resource and waiting to acquire additional
resources that are being held by other processes
c) A process must hold at least one resource and not be waiting to acquire additional
resources
d) None of these
View Answer
Answer: b
Explanation: None.
7) Deadlock prevention is a set of methods :
a) to ensure that at least one of the necessary conditions cannot hold
b) to ensure that all of the necessary conditions do not hold
c) to decide if the requested resources for a process have to be given or not
d) to recover from a deadlock
View Answer
Answer: a
Explanation: None.
Answer: a
Explanation: None.
3) Each entry in a segment table has a :
a) segment base
b) segment peak
c) segment limit
d) segment value
View Answer
Answer: a and c
Explanation: None.
4) The segment base contains the :
a) starting logical address of the process
b) starting physical address of the segment in memory
c) segment length
d) None of these
View Answer
Answer: b
Explanation: None.
advertisements
5) The segment limit contains the :
a) starting logical address of the process
b) starting physical address of the segment in memory
c) segment length
d) None of these
View Answer
Answer: c
Explanation: None.
6) The offset d of the logical address must be :
a) greater than segment limit
b) between 0 and segment limit
c) between 0 and the segment number
d) greater than the segment number
View Answer
Answer: b
Explanation: None.
7) If the offset is legal :
a) it is used as a physical memory address itself
b) it is subtracted from the segment base to produce the physical memory address
c) it is added to the segment base to produce the physical memory address
d) None of these
View Answer
Answer: a
Explanation: None.
8) When the entries in the segment tables of two different processes point to the same
physical location :
a) the segments are invalid
b) the processes get blocked
c) segments are shared
d) All of these
View Answer
Answer: c
Explanation: None.
9) The protection bit is 0/1 based on : (choose all that apply)
a) write only
b) read only
c) read write
d) None of these
View Answer
Answer: b and c
Explanation: None.
advertisements
10) If there are 32 segments, each of size 1Kb, then the logical address should have :
a) 13 bits
b) 14 bits
c) 15 bits
d) 16 bits
View Answer
Answer: a
Explanation: To specify a particular segment, 5 bits are required. To select a particular
byte after selecting a page, 10 more bits are required. Hence 15 bits are required.
11) Consider a computer with 8 Mbytes of main memory and a 128 K cache. The cache
block size is 4 K. It uses a direct mapping scheme for cache management. How many
different main memory blocks can map onto a given physical cache block ?
a) 2048
b) 256
c) 64
d) 8
View Answer
Answer: c
Explanation: None.
12) A multilevel page table is preferred in comparison to a single level page table for
translating virtual address to physical address because :
a) it reduces the memory access time to read or write a memory location
b) it helps to reduce the size of page table needed to implement the virtual address space
of a process
c) it is required by the translation look aside buffer
d) it helps to reduce the number of page faults in page replacement algorithms
View Answer
Answer: b
Explanation: None.
1) Physical memory is broken into fixed-sized blocks called ________.
a) frames
b) pages
c) backing store
d) None of these
View Answer
Answer: a
Explanation: None.
2) Logical memory is broken into blocks of the same size called _________.
a) frames
b) pages
c) backing store
d) None of these
View Answer
Answer: b
Explanation: None.
3) Every address generated by the CPU is divided into two parts : (choose two)
a) frame bit
b) page number
c) page offset
d) frame offset
View Answer
Answer: b and c
Explanation: None.
d) None of these
View Answer
9) The operating system maintains a ______ table that keeps track of how many frames
have been allocated, how many are there, and how many are available.
a) page
b) mapping
c) frame
d) memory
View Answer
Answer: c
Explanation: None.
10) Paging increases the ______ time.
a) waiting
b) execution
c) context switch
d) All of these
View Answer
Answer: c
Explanation: None.
11) Smaller page tables are implemented as a set of _______.
a) queues
b) stacks
c) counters
d) registers
View Answer
Answer: d
Explanation: None.
advertisements
12) The page table registers should be built with _______.
a) very low speed logic
b) very high speed logic
c) a large memory space
d) None of these
View Answer
Answer: b
Explanation: None.
13) For larger page tables, they are kept in main memory and a __________ points to the
page table.
a) page table base register
Netwroking
1. When collection of various computers seems a single coherent system to its client, then
it is called
a) computer network
b) distributed system
c) both (a) and (b)
d) none of the mentioned
View Answer
Answer:b
Explanation:None.
2. Two devices are in network if
a) a process in one device is able to exchange information with a process in another
device
b) a process is running on both devices
c) PIDs of the processes running of different devices are same
d) none of the mentioned
View Answer
Answer:a
Explanation:None.
3. Which one of the following computer network is built on the top of another network?
a) prior network
b) chief network
c) prime network
d) overlay network
View Answer
Answer:d
Explanation:None.
4. In computer network nodes are
a) the computer that originates the data
b) the computer that routes the data
c) the computer that terminates the data
d) all of the mentioned
View Answer
Answer:d
Explanation:None.
advertisements
Answer:a
Explanation:None.
10. Which one of the following extends a private network across public networks?
a) local area network
b) virtual private network
c) enterprise private network
d) storage area network
View Answer
Answer:b
Explanation:None.
This set of Computer Networks Questions & Answers focuses on Network Utilities.
1) Ping can
a) Measure round-trip time
b) Report packet loss
c) Report latency
d) All of the mentioned
View Answer
Answer: d
Explanation: None.
2) Ping sweep is a part of
a) Traceroute
b) Nmap
c) Route
d) Ipconfig
View Answer
Answer: b
Explanation: A ping sweep is a method that can establish a range of IP addresses which
map to live hosts and are mostly used by network scanning tools like nmap.
3) ICMP is used in
a) Ping
b) Traceroute
c) Ifconfig
d) Both a and b
View Answer
Answer: d
Explanation: None.
advertisements
4) _____ command is used to manipulate TCP/IP routing table.
a) route
b) Ipconfig
c) Ifconfig
d) Traceroute
View Answer
Answer: a
Explanation: None.
5) If you want to find the number of routers between a source and destination, the utility
to be used is.
a) route
b) Ipconfig
c) Ifconfig
d) Traceroute
View Answer
Answer: d
Explanation: None.
6) Which of the following is related to ipconfig in Microsoft Windows ?
a) Display all current TCP/IP network configuration values
b) Modify DHCP settings
c) Modify DNS settings
d) All of the mentioned
View Answer
Answer: d
Explanation: None.
7) This allows to check if a domain is available for registration.
a) Domain Check
b) Domain Dossier
c) Domain Lookup
d) None of the mentioned
View Answer
Answer: a
Explanation: None.
c) 8bytes
d) 100bits
View Answer
Answer: b
Explanation: An IPv6 address is 128 bits long.
2. The header length of an IPv6 datagram is _____.
a) 10bytes
b) 25bytes
c) 30bytes
d) 40bytes
View Answer
Answer: d
Explanation: IPv6 datagram has fixed header length of 40bytes, which results is faster
processing of the datagram.
3. In the IPv6 header,the traffic class field is similar to which field in the IPv4 header?
a) Fragmentation field
b) Fast-switching
c) ToS field
d) Option field
View Answer
Answer: c
Explanation: This field enables to have different types of IP datagram.
4. IPv6 doesnot use ______ type of address
a) Broadcast
b) Multicast
c) Anycast
d) None of the mentioned
View Answer
Answer: a
Explanation: Broadcast has been eliminated in IPv6.
advertisements
5. These are the features present in IPv4 but not in IPv6.
a) Fragmentation
b) Header checksum
c) Options
d) All of the mentioned
View Answer
Answer: d
Explanation: All the features are only present in IPv4 and not IPv6.
1. The number of objects in a Web page which consists of 4 jpeg images and HTML text
is ______
a) 4
b) 1
c) 5
d) None of the mentioned
View Answer
Answer: c
Explanation: 4 jpeg images + 1 base HTML file.
2. The default connection type used by HTTP is _____
a) Persistent
b) Non-persistent
c) Either of the mentioned
d) None of the mentioned
View Answer
Answer: a
Explanation: None.
3. The time taken by a packet to travel from client to server and then back to the client is
called ____
a) STT
b) RTT
c) PTT
d) None of the mentioned
View Answer
Answer: b
Explanation: RTT stands for round-trip time.
4. The HTTP request message is sent in ____ part of three-way handshake.
a) First
b) Second
c) Third
d) None of the mentioned
View Answer
Answer: c
Explanation: None.
5. In the process of fetching a web page from a server the HTTP request/response takes
______ RTTs.
a) 2
b) 1
c) 4
d) 3
View Answer
Answer: b
Explanation: None.
advertisements
6. The first line of HTTP request message is called ____
a) Request line
b) Header line
c) Status line
d) Entity line
View Answer
Answer: a
Explanation: The line followed by request line are called header lines and status line is
the initial part of response message.
7. The values GET, POST, HEAD etc are specified in ____ of HTTP message
a) Request line
b) Header line
c) Status line
d) Entity body
View Answer
Answer: a
Explanation: It is specified in the method field of request line in the HTTP request
message.
8. The ______ method when used in the method field, leaves entity body empty.
a) POST
b) GET
c) Both of the mentioned
d) None of the mentioned
View Answer
Answer: b
Explanation: None.
9. The HTTP response message leaves out the requested object when _____ method is
used
a) GET
b) POST
c) HEAD
d) PUT
View Answer
Answer: c
Explanation: None.
10. Find the oddly matched HTTP status codes
a) 200 OK
b) 400 Bad Request
c) 301 Moved permanently
d) 304 Not Found
View Answer
Answer: d
Explanation: 404 Not Found.
11. Which of the following is not correct ?
a) Web cache doesnt has its own disk space
b) Web cache can act both like server and client
c) Web cache might reduce the response time
d) Web cache contains copies of recently requested objects
View Answer
Answer: a
Explanation: None.
advertisements
12. The conditional GET mechanism
a) Imposes conditions on the objects to be requested
b) Limits the number of response from a server
c) Helps to keep a cache upto date
d) None of the mentioned
View Answer
Answer: c
Explanation: None.
13. Which of the following is present in both an HTTP request line and a status line?
a) HTTP version number
b) URL
c) Method
d) None of the mentioned
View Answer
Answer: a
Explanation: None.
1. DHCP (dynamic host configuration protocol) provides _____ to the client.
a) IP address
b) MAC address
c) url
d) none of the mentioned
View Answer
Answer:a
Explanation:None.
2. DHCP is used for
a) IPv6
b) IPv4
c) both (a) and (b)
d) none of the mentioned
View Answer
Answer:c
Explanation:None.
3. The DHCP server
a) maintains a database of available IP addresses
b) maintains the information about client configuration parameters
c) grants a IP address when receives a request from a client
d) all of the mentioned
View Answer
Answer:d
Explanation:None.
4. IP assigned for a client by DHCP server is
a) for a limited period
b) for unlimited period
c) not time dependent
d) none of the mentioned
View Answer
Answer:a
Explanation:None.
advertisements
5. DHCP uses UDP port ____ for sending data to the server.
a) 66
b) 67
c) 68
d) 69
View Answer
Answer:b
Explanation:None.
Answer:c
Explanation:None.