Professional Documents
Culture Documents
1. class Main {
public static void main (String args[ ])
{
System.out.println(f1 ());
}
int f1( )
{
return 50;
}
}
What is the output of the above code?
Ans: It gives compiler error. Because in java non static methods cannot be called in static
methods
2. class Main
{
public static void main (String args [])
{
int t=1;
if(t)
{
System.out.println("Hello");
}
else
{
System.out.println("Hi");
}
}
}
Incompatible types: int is not converted to Boolean in java. This works only in C/C++.
3. class Main
{
public static void main (String args [])
{
String x = new String("nmamit");
String y = new String ("nmamit");
if (x == y)
System.out.println("Equal");
else
System.out.println("Not equal");
}
}
The output of the above program is
5. Which of the following methods of Thread class is used to obtain the priority of a given
thread?
Ans: getPriority()
6. Suppose A is an abstract class and B is a concrete subclass of A and both have default
constructors
Which of the following is correct?
1. A a = new A( );
2. A a = new B( ):
3. B b = new B( );
4. B b = new A( );
Ans: 2 and 3 are correct.
Only concrete classes can be instantiated. Abstract class reference variable can be created.
Ans: Combinational circuits are often faster than sequential circuits. Combinational circuits do
not require memory elements whereas the sequential circuits need memory devices to perform
their operations in sequence. Latches and Flip-flops come under sequential circuits.
14. Which of the following is an ambiguous condition in a NAND- based S'-R' flip flop?
Ans: S’=0 and R’=0 is an ambiguous condition because both the output will be HIGH. In this case
system goes to an unexpected state.
16. Consider a 4 bit Johnson counter with an initial value of 0000. The counting sequence of this
counter is:
Ans: The four bit Johnson's counter connects the complement of the output of the last shift
register to the input of the first register ,1 bit will shift/cycle It will work as follows:
Inititally- 0000-0 //Last 0 complemented and fed as input to first register
1000 -8
1100-12
1110-14
1111-15 // last 1 complemented and 0 is fed to the first register
0111-7
0011-3
0001-1
0000-0
Hence the sequence is- 0,8,12,14,15,7,3,1,0
17. What is the minimum number of gates required to implement the Boolean function (AB+C)if
we have to use only 2-input NOR gates?
Ans: AB + C= (A + C)(B + C) = ((A+C)' + (B+C)')'
Hence 3 NOR gates are required
1.The technique used to store programs larger than the memory is ____________
a.Buffers b.Disks c.Overlays d.Extension registers
Answer : Overlays
Explanation: In this, only a part of the program getting executed is stored on the memory
and later swapped in for the other part
2.The time lost due to the branch instruction is often referred to as ____________
a.Delay b.Branch Penalty c.Latency d.Redundancy
Answer : Branch Penalty
Explanation: This time also retards the performance speed of the processor.
4.Complete the following analogy:- Registers are to RAM’s as Cache’s are to ___________
a.TLB b.Overlays c.Page Table d.Latency
Answer :TLB
6.The method of mapping the consecutive memory blocks to consecutive cache blocks is
called ______
a.Set associative b.Associative c.Indirect d.Direct
Answer: Direct
Explanation: This method is most simple to implement as it involves direct mapping of
memory blocks.
7. The most Flexible way of logging the return addresses of the subroutines is by using
_______
a.Stacks b.Memory Locations c.Registers d.None
Answer : Stacks
Explanation: The stacks are used as Logs for return addresses of the subroutines.
9.In associative mapping, in a 16 bit system the tag field has ______ bits.
a.8 b.12 c.10 d.7
Asnswer : 12
Explanation: The Tag field is used as an id for the different memory blocks mapped to the
cache.
PYTHON:
print(str1[2:9])
a. ormat
b. formatio
c. orma
d. formati
Answer :
Ans : formati
Explanation: Concept of slicing is used in this question. In string slicing,the output is the
substring starting from the first given index position i.e 2 to one less than the second given
index position
i.e.(9-1=8) of the given string str1. Hence, the output will be "formati".
print(set([x]))
a.{1,2,4,2} b.{1,3,2} c.{2} d.{4}
Answer : {4}
The output of the following code is {4}
a. Transport
b. Physical
c. Presentation
d. Data Link
ANS: a. Transport
a. Simplex lines
b. Half-duplex lines
c. Full-duplex lines
d. Biflex-line
ANS: b. Half-duplex lines
a. Non-zero
b. Zero
c. The quotient at the sender
d. Equal to the remainder at the sender
ANS: c. The quotient at the sender
5. Which of the following is an example of a client-server model?
a. TELNET
b. FTP
c. DNS
d. All of the above
ANS: d. All of the above
6. Ananya is setting up a small network in her home so that she can study for
her MCSE exams. She doesn't have a lot of money to spend on hardware, so
she wants to use a network topology that requires the least amount of
hardware possible. Which topology should she select?
a. Star
b. Bus
c. Token-Ring
d. Ethernet
ANS: b. Bus
7. Frames from one LAN can be transmitted to another LAN via the device:
a. Router
b. Bridge
c. Repeater
d. Modem
ANS: b. Bridge
a. 16 – bits
b. 32 – bits
c. 48 – bits
d. 64 – bits
ANS: b. 32 – bits