0% found this document useful (0 votes)
7 views3 pages

Infoview Set5

The document contains a series of multiple-choice questions related to programming concepts in C and Java, covering topics such as data types, function pointers, exception handling, and object-oriented principles. Each question provides four answer options, requiring knowledge of programming syntax and behavior. The questions are designed for assessing understanding of core programming concepts and practices.

Uploaded by

karthivela4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views3 pages

Infoview Set5

The document contains a series of multiple-choice questions related to programming concepts in C and Java, covering topics such as data types, function pointers, exception handling, and object-oriented principles. Each question provides four answer options, requiring knowledge of programming syntax and behavior. The questions are designed for assessing understanding of core programming concepts and practices.

Uploaded by

karthivela4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

VSB ENGINEERING COLLEGE-KARUR

CENTRE FOR TRAINING AND PLACEMENT


INFOVIEW SET-5
1. What do the following declaration signify?
int (*pf)();
a. pf is a pointer to function b. pf is a function pointer. c. pf is a pointer to a function which
return int d. pf is a function of pointer variable
2. What do the following declaration signify?
void *cmp();
a. cmp is a pointer to an void type. b. cmp is a void type pointer variable
c. cmp is a function that return a void pointer d. cmp function returns nothing
3. In which numbering system can the binary number 1011011111000101 be easily converted to?
a. Decimal system b. Hexadecimal systemc. Octal system d. No need to convert
4. Which bitwise operator is suitable for turning off a particular bit in a number?
a. && operator b. & operator c. || operator d. ! operator
5. In a binary tree, certain null entries are replaced by special pointers which point to nodes higher in the tree for
efficiency. These special pointers are called
a. Leaf b. branch c. path d. thread
6. To use the function tolower(), which of the following header file should be used
a. string.h b. conio.h c. ctype.h d. None of the mentioned
7. The size of a structure can be determined by
a. size of variable name b. sizeof(struct tag)
a. Only a b. Only b c. Both a and b d. none of the above
8. Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?
a. rem = 3.14 % 2.1; b. rem = modf(3.14, 2.1); c. rem = fmod(3.14, 2.1);
d. Remainder cannot be obtain in floating point division
9. Which of the following global variable is set when the log function (defines in ) fails?
a. exceptionno b. errno c. log_error d. error
10. Which of the following is not a stream that is opened by every c program?
a. stdlog b. stdout c. stdin d. stderr
11. According to ANSI specifications which is the correct way of declaring main when it receives command-line
arguments?
a. int main(int argc, char *argv[])
b. int main(argc, argv)
int argc;
char *argv;
c. int main()
{
int argc;
char *argv;
}
d. None of above
12. Which of the following structure declaration doesn't require pass-by-reference?
a. struct{int a;}s; main(){ }
b. struct temp{int a;}; main() { struct temp s; }
c. struct temp{int a;};
main(){}
struct temp s;
d. None of the mentioned
13. While coding in c programming for "call by reference" we pass
a. Address of variable b. Value of variable c. Either value or address d. Both value and address
14. A utility programme that takes a procedure and searches a library to locate copies of any procedures called but not
defined in the first procedure, is called
a. Linker b. Re-locator c. Loader d. Text editor
15.what among the following is a unconditional control structure:
a. do-while b. if-else c. goto d. for
16. Two trains are moving in opposite directions with speed of 60 km/hr and 90 km/hr respectively. Their
lengths are 1.10 km and 0.9 km respectively. the slower train cross the faster train in --- seconds
A. 56 B. 48 C. 47 D. 26
17. Consider the 3 character combinations that can be generated with A, L and T. What percentage of the combinations
generated will not contain an A in the first position.
A. 66.7% B. 65.5% C. 66.9% D. 66%
18. 3. The letters M, H, T, and A are written on slips of paper. The four slips of paper are placed in a hat. The slips are
then selected one at a time from the hat. What is the probability that the order in which they are chosen spells MATH?
A. 1/4 B. 1/16 C. 1/12 D. 1/24
19. A man takes 5 hours 45 min in walking to a certain place and riding back. He would have gained 2 hours by riding
both ways. The time he would take to walk both ways is
A. 11 hrs B. 8 hrs 45 min C. 7 hrs 45 minD. 9 hts 20 min
20. Excluding stoppages, the speed of a bus is 54 kmph and including stoppages, it is 45 kmph. For how many minutes
does the bus stop per hour? A. 12 B. 11 C. 10 D. 9
Java Questions
1. What is the size of double type ?
a. 16 bit b. 32 bit c. 64 bit d. 128 bit
2. What is the size of short type ?
a. 8 bit b. 16 bit c. 32 bit d. 128 bit
3. Which keyword is used to provide explicit access of a code block to single thread ?
a. Transient b. Final c. Explicit d. Synchronized
4. Which of the following exception is thrown when we try to access element which is beyond the size ?
a. NullPointerException b. ArrayIndexOutOfBoundException
c. ArithmeticException d. ParseException
5. Checked exception needs to be ...
a. Caught b. Method needs to declare that it throws these exception
c. Either A or B d. Both A and B
6. Collections.sort can only be performed on ..
a. Set b. List c. Map d. Any Collection implementation
7. Effective Java 6 ,TreeMap implements ...
a. Map Interface b. SortedMap Interface c. NavigableMap Interfaced. SortedNavigableMap
Interface
8. Which of the following is not possible ?
a. try block followed by catchb. try block followed by finally
c. try block followed by catch block and then finally
d. try block without catch or finally block
9. Which of the following is not the difference between Singleton and Static class ( Class with static members
only ) ?
a. Only one object can be created for Singleton class whereas No objects are created for static class.
b. Singleton class instance is initiated using new keyword whereas static class instance is created using
static method.
c. Singleton class can be serialized whereas Static class cannot be.
d. Singleton Class can participate in runtime Polymorphism whereas Static class cannot.
10. Which of the following is false about main method ?
a. It should be declared public and static b. it should have only 1 argument of type String array
c. We can override main method d. We can overload main method
11. Which of the following is false about Constructors ?
a. Constructor can be overloaded
b. A no argument constructor is provided by the compiler if we declare only constructors with
arguments.
c. Constructors shouldn't have any return types , not even void.
d. If super is not explicitly called, still super() is intrinsically added by the compiler.
12. Variables of an interface are intrinsically ...
a. transient b. final c. public d. static
13. Which of the following class creates mutable objects ?
a. Boolean b. File c. String d. StringBuffer
14. Which of the following is not true for final variables ?
a. They cannot be changed after initialization
b. They can be initialized within static method
c. They can be declared and initialized together at the same place
d. They can be initialized within constructor
15. Which of the following is false for final ?
a. Final methods cannot be overridden b. Final methods cannot be overloaded
c. Final classes cannot be subclassed d. Final class cannot be abstract
16. Invoking start twice on same thread leads to ..
a. ClassCastExceptionb. NullPointerException
c. InterruptedException d. IllegalStateException
17. Which of the following is false about varargs ?
a. VarArgs argument should have data type followed by three dots
b. Three dots should be consecutive and not separated by even space
c. We cannot have space before and after the dots
d. If there is a varargs in the method, it should be only one and the last one.
18. Which of the following is not valid varargsdeclaration ?
a. int sum (int... numbers) b. int sum (.int .. numbers)
c. int sum (int ... numbers) d. int sum (int x, int ... numbers)
19. Strings in switch were introduced in Which Java version ?
a. Java 5 b. Java 6 c. Java 7 d. Java
20. Which of the following doesn't extend Collection interface ?
a. Set b. List c. Map d. Queue

You might also like