1. Consider
the following program:
answer.
Cost 23
answer. Cost 24
import
myLibrary.*;
public
class ShowSomeClass
{
//
code for the class...
}
What
is the name of the java file containing this program?
A.
myLibrary.java
B. ShowSomeClass.java
C.
ShowSomeClass
D.
ShowSomeClass.class
E.
Any file name with the java suffix will do
2.
A constructor
A.
must have the same name as the class it is declared within.
B.
is used to create objects.
C.
may be declared private
D. A and B
E.
A, B and C
3.
Which of the following may be part of a class definition?
A.
instance variables
B.
instance methods
C.
constructors
D. all of the above
E.
none of the above
4.
What is byte code in the context of Java?
A. The type of code generated by a Java
compiler
B.
The type of code generated by a Java Virtual Machine
C.
It is another name for a Java source file
D.
It is the code written within the instance methods of a class.
E.
It is another name for comments written within a program.
5.
int j;
for(int i=0;i<14;i++) {
if(i<10) {
j = 2 + i;
}
System.out.println(“j: ” + j +
” i: ” + i);
}
What is WRONG with the above
code?
A.Integer “j” is not
initialized.
B.Nothing.
C You cannot declare integer i
inside the for-loop declaration.
D The syntax of the “if”
statement is incorrect.
E You cannot print integer
values without converting them to strings.
6.
Given the following piece of code:
public
class Test {
public static void main(String args[]) {
int i = 0, j = 5 ;
for( ; (i < 3) && (j++ < 10) ;
i++ ) {
System.out.print(" " + i + "
" + j );
}
System.out.print(" " + i + "
" + j );
}
}
what
will be the result?
(a) 0 6 1 7 2 8 3 8
(b) 0 6 1 7 2 8 3 9
(c) 0 5 1 5 2 5 3 5
(d) compilation fails
7.
If s = "text", what is the value returned by s.length()?
false
true
4
5
8.
What is the value of k after the following code fragment?
int
k = 0;
int
n = 12
while
(k < n)
{
k = k + 1;
}
0
11
12
Unknown
9.
to compile java program which command is used?
a. javac
b.
jcompile
c.
java
d.
javadoc
10.
to create an array of 5 int which statement is correct?
a.
int a[]=int new[5]
b.
int a[5]=new a[]
c. int a[]=new int[5]
d.
int a[]=new a[]
11.
the new keyword is used to….
a.
call a method of a class
b. allocate memory to an object
c.
allocate memory to a class
d.
none of the above
12.
when a variable is declare as static,
a. it is automatically initialized
before an object of its class is created
b.
it becomes constant
c.
its value is changed every time an object of its class is created
d.
it becomes public
13.
to implement interface which keyword is used?
a.
extends
b.
interface
c. implements
d.
implement
14.
deadlock is situation when
a. two or more threads have circular
dependencies
b.
two or more threads are typing to access a same object
c.
two or more threads are waiting for a resources
d.
none of the above
15.
when a method can throw an exception then it is specified by ……… keyword
a.
finally
b.
throw
c. throws
d.
throwexception
16.
linear collection of data elements the linear node is given by mean of pointer
is called
a. linked list
b.
node list
c.
primitive list
d.
none
17.
in circular linked list insertion of record involves modification of
a.
no pointer
b.
1 pointer
c. 2 pointer
d.
3 pointer
18.
what are the advantages and disadvantages of linked list?
19.
if poniter ptr points to node in linked list then which of the following
expression will be true when ptr points to tail node of the list?
a.
ptr==null
b. ptr->link==null
c.
ptr->data==null
d.
ptr->data==-1
20.
which data structure are used to implement queue
a.
tree
b. linked list
c.
doubly linked list
d.
all
21.
which of the following operation is not effieciently supported by a singly
linked list
a.
accessing the elements in the current position
b.
insertion after the current position
c. insertion before the current
position
d.
moving to the position immediately following the current position
22.
advantages of list over array?
23.
what operation is supported in constant time by doublu linked list but not by
singly linked list?
a.
advance
b. move back
c.
first
d.
retrieve
24.
solve this using prim’s and kruskal’s
algorithm
a.
b.
c.
25. true/false
1.
tree is a graph with cycles. (false)
2.
minimum spanning tree is a tree with minimum weight among all the spanning
trees. (true)
3.
files with nonindexed and indexed records are type of structured file
model (true)
4.
every binary tree has at least one node
(true)
5.
android runtime is the part of application framework (false)
6.
Dalvik compiler converts .java files into .class files (false)
7.
ios supports x86 architechture type (false)
8.
WAP stands for wireless application protocol (true)
9.
WAP is designed to work for micro browsers on mobile (true)
10.
GSM is one of the wireless bearers in WAP architechture (true)
26.
all tags of html
27.
latest android version with example
28.
the tools used to convert a ‘C’ program to machine language of another
processor is called as:
a.
linker
b. cross compiler
c.
compiler
d.
cross linker
29.
difference between while and do-while statements
30.
‘break statements when executed, the control is transferred…..
a. outside loop to the nest statement
after the loop
b.
beginning of the loop i.e to the first statement in the loop
c.
outside the function to the next function in the program
d.
beginning of the function to the first statement in the function
31.
according to the following code select best suitable option
Int
x=5,y=3,z;
A=add(&x,&y);
- Function add is called by passing the values
- Function add is called by passing references
- Bothe a and b
- None of the above
32.
when an array is passed to a function it can be said that…..is passed.
a.
address of the array
b.
value of the first element of the array
c. address of the first element of the
array
d.
number of elements in the array
33.
parameters passed by caller function are called as the parameters
a. actual
b.
formal
c.
informal
d.
reference
34.
index of the last element of an array of ‘n’ elements will be
a.
n+1
b.
n
c. n-1
d.
none of the above
35.
the life of a variable declared as automatic storage class is
a.
until program completes its execution
b. till the control remains in the
function where it is declared
c.
until the computer remains on
d.
none of the above
36. which of the following are not valid
expressions in C
a.
a=2+(b=5);
b.
a=b=c=5;
c.
a=11%3
d. b+5=2
37.
which of the following is not a valid relational operator?
a.
= =
b. =>
c.
<=
d.
>>=
38.
what is the final value of x when the code
int
x;
for(x=0;x<=10;x++)
{}
is run?
- 10
- 9
- 0
- 11
39.
which of the following loops will definitely execute atleast once, even if the
condition is not satisfied?
a.
for
b.
while
c. do-while
d.
none
40. which of the following is a selection
statement in C?
a.
if-else
b.
switch case
c. both of the above
d.
none of the above
41.
initialization in the for loop is optional
a. true
b.
false
c.
depends on the condition
d.
none of the above
42.
which of the following is false for a “switch” statement in C?
a.
break statement is compulsory after each case
b.
default statement is compulsory
c. there is a limit on the maximum
number of cases
d.
none
43.
true/false
a.
the while loop can be replaced by for loop in all the cases. (true)
b.
the do-while loop is entry controlled loop.
(false)
c.
the while loop is an exit controlled loop.
(false)
d.
in the if-else statement else is optional.(false)
e.
there can be a condition in the brackets associated with the switch statement.
(false)
f.
break statement is compulsory after every case in the switch case statement.
(false)
g.
the label in a switch case statement can be a condition or expression. (false)
h.
the void specifier is used if a function does not have return type. (true)
i.
the actual and formal parameters are the same variables with different names.
(false)
j.
the size of an array can be changed
during the execution of the program. (false)
k.
array is collection of mixed data types.(false)
44.
variables declared inside the parenthesis of a function have ……….
Visibility.
a. local
b.
global
c.
module
d.
universal
45.
when an array is passed to a function, it can be said that ………. Is passed.
a.
address of the array
b.
value of the first element of the array
c. address of the first element of the
array
d.
number of elements in the array
46.
the parameters passed by the caller function are called as the …..parameters.
a. actual
b.
formal
c.
informal
d.
reference
47.
in 2 dimentional array with the name ‘a’ a statement a[i][j] indicates…………
a.
element with row number ‘i’ and column number ‘j’
b.
element with row number ‘j’ and column number ‘i’
c. element with row number ‘i-1’ and
column number ‘j-1’
d.
element with row number ‘j-1’ and column number ‘i-1’
48.
the correct syntax of declaring array is
a.
[array_size] data_type array_name
b.
array_name data_type [array_size]
c. data_type array_name [array_size]
d.
data_type [array_size] array_name
49.
initial value of an automatic storage class variable is
a.
zero
b. garbage
c.
1
d.
none
50.
the life of a variable declared externally is
a. until the program completes
execution
b.
till control remains in the function where it is declared
c.
until the computer remains on
d.
none of the above
51.
the function delay_us(x) generates a delay of
a.
x seconds
b.
x miliseconds
c. x microseconds
d.
none
52.
which directive is used to indicate that a function is ISR
a. #int _<interrupt_name>
b.
#ISR_<interrupt_name>
c.
#interrupt_name
d.
#interrupt_<interrupt_name>
53.
the funcition used to set the timer mode for a timer ‘x’ is
a.
set_timerx(mode)
b. setup_timerx(mode)
c.
settings_timerx(mode)
d.
timerx(mode)
54.
the function used to stop communication on the i2c port of PIC18f877 is
a.
i2c_read()
b.
i2c_output(n)
c.
i2c_write(n)
d. i2c_stop()