Tuesday 17 December 2013

Write a program which takes a integer and prints “YES” if its binary code (Excluding most significant bit) and its reverse are same;otherwise print “NO” for example 0101101101101

#include<stdio.h> int main() { int num,NOBITS; unsigned int firstbitmask=1,lastbitmask,x,y; NOBITS=8*sizeof(int)-1; lastbitmask=firstbitmask<<NOBITS; printf("Enter a number"); scanf("%d",&num); while(lastbitmask>firstbitmask) { x=num&lastbitmask; y=num&firstbitmask; if(((x==0)&&(y==0))||(x && Y)) { lastbitmask <<=1; firstbitmask >>=1; } else break; } if(lastbitmask==firstbitmask) printf("YES"); else printf("NO"); return 0; }

Write a program which reads a set of integers into an integer array and then prints those numbers which occurs only once

#include<stdio.h> int main() { int i, n, a[10], j, c; printf("Enter a number\n"); scanf("%d",&n); printf("Enter %d number\n",n); for(i=0;i<n;i++) {scanf("%d",&a[i]);} for(i=0;i<n;i++) /*To traverse array element by element */ { c=0; /* counter is initialized to 0 */ for(j=0;j<n;j++) { /* comparing ith element with all other elements */ If(a[i]==a[j]) c++; } if(c==1) printf("%d\n",a[i]); } return 0; }

Tuesday 20 August 2013

MCQs os..cn..st

[1 ] With a Single resource, deadlock occurs
A. If there are more than two processes competing for that resource
B. If there are only two processes competing for that resource
C. If there is a single process competing for that resource
D. None of these

[2]A state is safe if the system can allocate resources to each process(up to its maximum)
in some order and still avoid deadlock. Then
A. Deadlocked state is unsafe
B. Unsafe state may lead to a deadlock situation
C. Deadlocked state is a subset of unsafe state
D. All of these

[3] A Computer system has 6 tape drives, with ‘n’ processes competing for them. Each process may need 3 tape
drives. The maximum value of ‘n’ for which the system is guaranteed to be deadlock free is
A.4  B.3  C.2  D.1

[4] ‘m’ processes share ‘n’ resources of the same type. The maximum need of each process
doesn’t exceed ‘n’ and the sum all their maximum needs is always less than m+n In this set up
A.Deadlock can never occur
B.Deadlock may occur
C.Deadlock has to occur
D.None of these

[5] Consider a system having ‘m’ resources of the same type. These resources are shared by 3 processes A,B,C which have peak time demands of 3,4,6 respectively .The minimum value of ‘m’ that ensures deadlock will never occur is
A.11  B.12  C.13  D.14 

[1] The amount of uncertainty in a system of symbol is called
A.Bandwidth
B.Entropy
C.Loss
D.Quantum

[2] The Topology with highest reliability is
A.Bus topology
B.Star topology
C.Ring topology
D.Mesh topology

[3] In which topology, if there are n devices in a network, each device has n-1 ports for cables?
A.Mesh
B.Star
C.Bus
D.Ring

[4] IP address can be used to specify a broadcast and map to hardware broadcast if available. By conversion broadcast address has hosted with all bits
A.0
B.1
C.Both(A) and (B)
D.None of these

[5] ARP (Address resolution protocol) is
A.A TCP/IP protocol used to dynamically bind a high level IP address to a low level Physical hardware address
B.A TCP/IP high level protocols for transferring files from one machine to another
C.A protocol used to monitor computers
D.A protocol that handles error and control messages

[1] Testing is best done
A.By an independent test team
B.By the programmer
C.By the designer
D.By the analyst

[2] Fasi wants to test his module where he had forgotten to initialize x
IF x=0 then
write(“abnormal”);
Else
write(“normal”);
End if;
A.The tests he generates may give non-repeatable results
B.The tests will always given repeatable results
C.He will find the bug for all runs of the program
D.None of the above

[3] Neil wants to test the following program by generating random test values for x and y.
The error in the program is z=22 should be there
read(x);
read(y);
if(x==y) then
z=2;
else
z=0;
end if
A.Random testing is insufficient as the bug may-never by detected
B.Random testing will always find the bug
C.Random testing always generates equal values of x and y
D.None of the above

[4] Consider two modules A and B, both utility programs in the same organization developed by the same team of
programmers, where a and b are sizes, respectively. The cost to develop each module is Ca and Cb. The efforts are Ea and Eb. If Ca>Cb then
A.Ea > Eb
B.Ea < Eb
C.Ea = Eb
D.Eq and Eb are incomparable

[5]This type of testing method attempts to find incorrect or missing functions, errors in data structures or
external database access, interface errors, performance errors and initialization and Termination errors. It is called as
A.White Box Testing
B.Grey Box Testing
C.Black Box Testing
D.Open Box Testing

Sunday 14 April 2013

C PROGRAMMING AND DATA STRUCTURES (VIVA)

1. What is Compiler ?
2. What is linker?
3. What is Assembler?
4. What is Preprocessor?
5. What is #define and #include in C? or What are the Preprocessor commands in C?
6. What is the purpose of header file in C program? stdio.h, conio.h, math.h, string.h, stdlib.h… etc, mention any 3 predefined functions in these header files?
7. What is Pseudo code?
8. Define Algorithm?
9. What is Flowchart ? What are the different symbols in it?
10. What is a program?
11. Explain the steps in the execution of C program?
12. Explain the Basic structure of a C program?
13. Where does the execution of a C program begin?
14. What is C?
15. Who developed C language?
16. Is C a Procedure oriented language ? Explain.
17. Is C top-down or bottom-up programming language ? Explain?
18. What are the features of C?
19. C is a portable language … Explain Portability?
20. C is a robust language… Explain robustness?
21. what are the limitations / disadvantages / drawbacks of C ?
22. What is a datatype?
23. How many datatypes in C?
24. What are the Basic Datatypes or Primitive datatypes in C ?
25. Explain the size and range of each datatypes in C ?
26. What is signed and Unsigned part of a datatype?
27. what is the size of short int , int and long int in bytes ?
28. 1 byte is… ? What is a byte ?
29. What are the Escape sequences in C?
30. Define Constants in C ? examples .
31. Define variables in C?
32. What is declaration in C?
33. What is definition of a variable in C?
34. What is the difference between Declaration and Definition of a variable?
35. Define scope and lifetimeof a variable?
36. What is the difference between the Global and Local declaration of a variable?
37. What is an Identifier?
38. What is Type Conversion/ Type casting ? Examples .
39. What is an Expression? Is there any difference between an Expression and an Equation?
40. What is the so called rule for the Evaluation of Expressions?
41. What is an Operator and Operand?
42. What is the use of Operator Precedence?
43. What is the Associativity of operators?
44. How many types of Operators in C and what are they?
45. What is the difference between Unary and Binary operators ? examples
46. Explain Bitwise operators in C?
47. What is Control structures in C?
48. Explain the Sequence structure with example?
49. Explain the Selection structure with example?
50. Explain the Iteration structure with example?
51. What is Recursion? How many types of Recursion? Explain the procedure? Explain Towers of Hanoi concept of Recursion?
52. What is the difference between Iteration and Recursion?
53. What are the Decision making statements in C? Explain with example?
54. What are the loop Control structures in C? Explain with example?
55. Flowcharts for if , if-else, else-if ladder, nested if , switch, for , while , do-while etc.,.
56. What is the syntax for if , if-else, else-if ladder, nested if , switch, for , while , do-while etc.,.
57. What is the Unconditional jumping statement in C?
58. What is difference between while and for loops ?
59. What are the Entry controlled and Exit controlled loops in C and Why?
60. Explain break, continue and goto statements in C with examples?
61. What is the difference between break and continue?
62. Why is C a structured programming language ? How is it achieved ?
63. Define a Function?
64. How many types of Functions in C?
65. What is the difference between User-defined and Standard library/Pre-defined functions?
66. Examples for User-defined functions?
67. Examples for Standard library functions?
68. Is main() a user-defined function or pre-defined function?
69. What is a Return type for a function?
70. What are the Return values in a function?
71. Classification of Functions based on Return type and Return values?
72. Explain the function with return type and return value with example?
73. Explain the function with return type and without return value with example?
74. Explain the function without return type and return value with example?
75. Explain the function without return type and without return value with example?
76. Explain the void type in C ?
77. Explain Nested Functions concept? How is it different from Recursive functions?
78. Define a Storage class in C?
79. What are the Storage classes in C?
80. What is extern, auto , static, register? … explain
81. What are the Qualifiers (or qualifier for a datatype)?
82. Define Array? How many types of Arrays ? examples
83. What is the representation, Declaration, Definition of 1-D , 2-D , 3-D arrays ?
84. What are the Applications of Arrays ?
85. What is a Jagged Array?
86. Define a Pointer?
87. How do u declare a pointer variable ?
88. what is * and & in pointer concept?
89. what is pointer to pointer?
90. Explain the pointers to arrays concept ?
91. Explain the pointers to functions concept?
92. What is the disadvantage of pointers concept in C?
93. What is the Calling function and Called function?
94. What are the Actual parameters /arguments and Formal parameters/arguments?
95. Explain the concept of pass by value / call by value?
96. Explain the concept of pass by reference / call by reference?
97. What are the types of memory allocation?
98. What is static allocation and dynamic allocation?
99. What is the difference between the static allocation and compile time allocation?
100. What are the dynamic memory management functions in C?
101. What is syntax for malloc() , calloc(), realloc() and free() functions ?
102. Define a string ? what are the string manipulation functions in C? Explain each with an example?
103. What are Command line arguments in C?
104. what is main(argc, *argv []) ?
105. What is arrays of strings ?
106. What are the Derived datatypes in C?
107. Define Structure ? How do u declare and initialize a structure variable?
108. Can u initialize a structure within the main() function ?
109. how do u access a structure variable?
110. Explain the concept of nested structures with example?
111. Explain the concept of arrays of structures and arrays within structures with an example?
112. what is pointers to structures?
113. What is self-referential structure?
114. Define Union in C?
115. Is there any difference between Structure and Union ?
116. what is the use of typedef ?
117. Explain the concept of bitfields in C?
118. What is a enumerated datatype in C?
119. Define a FILE ? what is a file descriptor, what are the values for it ?
120. What are the File I/O functions ?
121. What is a stream? What is Input stream and Output stream?
122. What are the standard I/O functions in files?
123. What are the formatted I/O functions in files?
124. What are the File status functions?
125. What is a text file?
126. What is a binary file?
127. Distinguish between a text file and binary file?
128. Define a Data structure ?
129. What are classification of Data structures?
130. Define sorting ?
131. What are the various sorting techniques?
132. What are the Internal and External sorting techniques?
133. What is Time Complexity?
134. What is Space Complexity?
135. What are the notations for Time and Space Complexities?
136. Explain the Bubble / exchange sort procedure? Complexity?
137. Explain Quick / Partition Exchange sort procedure? Complexity?
138. Explain Insertion / In-place sort procedure? Complexity?
139. Explain Selection sort procedure ? Complexity?
140. Explain Merge sort / External sort procedure ? Complexity?
141. Which is the Best sorting technique and Why?
142. Define Searching?
143. What are the various Searching techniques?
144. Explain the Sequential / Linear search procedure ? Complexity?
145. Explain the Binary search procedure ? Complexity?
146. Define an ADT? Give an Example.
147. What is a Stack ADT? What are the operations on stacks ? What are the applications ?
148. What is a Queue? What are the operations on queues ? What are the applications ?
149. What is a linked list? What are the operations on linked lists ? What are the applications ?
150. What is infix notation , prefix notation, postfix notation of an expression , explain with examples and conversions from infix to postfix .
151. Source code for:
• Palindrome
• Armstrong
• Fibonacci sequence (recursive and non-recursive)
• Factorial
• Prime number
• Even / Odd
• Roots of a Quadratic equation
• Swapping two numbers without using a temporary variable
• Program to reverse a string
• Logic for multiplication of matrices

CDS (UNIT-3) FREQUENTLY ASKED QUESTIONS

1. (a) What is a Preprocessor directive?
(b) Distinguish between function and Preprocessor directive?
(c) What is the significance of Conditional Compilation?
(d) How does the undefining of a pre-defined macro done?

2. (a) Write a program to demonstrate passing an array argument to a function? Consider the problem of finding largest of N numbers defined in an array.
(b) Write a recursive function power(base, exponent) that when invoked returns base exponent?

3. What do you mean by functions? Give the structure of the functions and explain about the arguments and their return values?

4. (a) Distinguish between the following.
(i) Actual and Formal arguments?
(ii) Global and Local variables?
(iii) Automatic and Static variables?
(b) Explain in detail about pass by value and pass by reference. Explain with a sample program?

5. (a) Distinguish between formal variable and actual variable.
(b) Distinguish between Local and Global variable.
(c) Distinguish between Call by value and Call by reference.

6. (a) What is the syntax followed in the definition of a macro?
(b) What are the advantages and disadvantages of macros?
(c) What is meant by conditional compilation? What are its advantages?

7. (a) What are the advantages and disadvantages of recursion?
(b) Write a C program to find the factors of a given integer using a function.

8. (a) Give some important points while using return statement.
(b) Write short notes on scope of a variable.

9. (a) Write short notes on auto and static storage classes.
(b) Write short notes on call by reference.

10. (a) Distinguish between user defined and built-in functions.
(b) What is meant by function prototype? Give an example for function prototype.

11. (a) Distinguish between getchar and scanf functions for reading strings.
(b) Write a program to count the number of words, lines and characters in a text.

12. (a) What do you mean by functions? Give the structure of the functions and explain about the arguments and their return values.
(b) Write a C program that uses a function to sort an array of integers.

13. Define an array. What are the different types of arrays? Explain

14. (a) Write a C program to do matrix multiplications.
(b) Write in detail about one dimensional and multidimensional arrays. Also write about how initial values can be specified for each type of array.

CDS (Unit-2) Frequently asked questions

1. Write the various steps involved in executing a C program and illustrate with the help of flow chart?
2. What is the difference between break and continue statements ? Explain with examples.
3. What is the purpose of goto statement? How is the associated target statement identified?
4.(a) What are constants?
(b) Name the different data types that C supports and explain them in detail.
5. (a) What is meant by looping? Describe any two different forms of looping with Examples.
(b) Write a program to print the following outputs using for loop.
i) 1
2 3
4 5 6
7 8 9 10

ii)1
2 2
3 3 3
4 4 4 4
6. What are the logical operators used in C and illustrate with examples?
7. Whar is the purpose of switch statement ? How does this statement differ from the other statements?
8. (a) What is an Expression ? What kind of information is represented by an Expression?
(b) What is an Operator? Describe several different types of operators that are included within the C language with an example each?
9. What are the different types of control statements available in C. Explain them with an example.
10. (a) What is the difference between signed integer and unsigned integer in terms of memory and range?
(b) Explain the basic structure of C program?
11. Explain the following and illustrate it with an example?
(a) Increment and Decrement Operator
(b) Conditional Operator
(c) Bitwise Operator
(d) Assignment operator
12. State the rules that are applied while evaluating expression in automatic type conversion?
13. (a) What is a String constant? How do string constants differ from character constants? Do string constants represent numerical values?
(b) Summarize the standard escape sequences in C? Describe them.
(c) What is a variable. How can variables be characterized? Give the rules for
variable declaration.
(d) What is a purpose of type declarations? What are the components of type declaration?
14.Write a program to determine and print the sum of the following harmonic
series for a given value of n: 1+1/2+1/3+1/4+…..+1/n.

Tuesday 26 February 2013

C programs in Arrays,Pointers and Structures

1)
a) Write a C Program to find the LCM of two given numbers using Recursion
b) You are given two sorted arrays, A and B, and A has a large enough buffer at the end to hold B.
Write a Function to merge B into A in sorted order.
void merge(int a[], int b[]);

2)
a) Write a C Program to sort the characters in a given string in ascending order
b) Write a C Program to print each word in a string in reverse order
Example : Input :- KMIT Engineering College
Output :- TIMK gnireenignE egelloC
3)
a) Write a C Program to Sort a Set of Student Records based on the Student Name in Descending
Order. Using Functions and Pointers

The Structure of the Student should consist of Sno, Sname and Marks

Sample Input :- Enter Student Details (Sno,Sname,Smarks):- 100 Raju 95
Enter Student Details (Sno,Sname,Smarks):- 95 Hari 90
Enter Student Details (Sno,Sname,Smarks):- 97 Vasu 85
Enter Student Details (Sno,Sname,Smarks):- 94 Rajesh 99

Output:- 97 Vasu 85
100 Raju 95
94 Rajesh 99
95 Hari 90

b)Write a C Program to Search a Given Element in an Array Using Recursion

4)
a) Write the Code for the following function
int * allocateMemory(int *a,int size)
The function should allocate memory for the variable a based on the size.
Read the elements into the array , return it and display it in main function.
b) Write a Macro to Swap two numbers without using third variable

ECE 2n-mid MCQ

1)
void fun(int x[])
{
x[0]=*x+100;
x[1]=*(x+1)+100;
}
void main( )
{ int a[2]={10,20};
fun(a);
printf("%d",a[1]);
}
A) 10 B) 20 C) 120 D) Error
Ans:- C
2)
#include
int func1(int m)
{
m++;
return m;
}

int func(int m)
{
++m;
return (m=func1(++m)); // Line 10
}

int main(int argc, char *argv[])
{
int k=35,z;
z=func(k);
printf(" %d ", z);
return 0;
}

A) 36
B) 37
C) 38
D) Compile Time Error 10
Ans:- C

3)
void main()
{
char p[20]; int i;
char *s="KMIT";
int length=strlen(s);
` for(i=0;i p[i]=s[length-i];
printf("%s",p);
}

A) gnirts
B) string
C) gnirt
D) None of these
Ans:- D

4) #include
#define MESS(m) printf("m")
void main()
{
MESS("KMIT");
MESS("Hyderabad");
}
A) KMIT Hyderabad
B) Compile Time Error
C) mm
D) Run Time error
Ans:- C

5) #include
void main()
{
int arr[]={0,1,2,3,4};
int *ptr,i;
for(ptr=arr+4;ptr>=arr;ptr--)
printf(" %d ", arr[ptr-arr]);
}

A) 0 1 2 3 4
B) 4 3 2 1 0
C) 1000 1004 1008 1012 1016
D) Compile Time error
E) Run Time Error
Ans:- B

6) #include
void main()
{
static char str[]={48,48,48,48,48,48,48,48,48};
char *s;
int i;
s=str;
for(i=0;i<9;i++)
{
if(*s)
printf("%c ",*s);
s++; //Line 10
}
}
a) 0 0 0 0 0 0 0 0 0
b) Prints Nothing
c) Compile Time error at Line 10
d) Run Time Error

Ans :- a
7) #include
void main()
{
struct s1
{
char *str;
struct s1 *ptr;
};
static struct s1 arr [] ={ {"Nikhil",arr+1},{"Aditya",arr+2},{"Sudheer",arr}, };
struct s1 *p[3];
int i;
for(i=0;i<=2;i++)
p[i]=arr[i].ptr;
printf(" %s ",p[0]->str);
printf(" %s ",(*p)->str);
printf(" %s ",(**p));
}
a) Compile Time Error
b) Run Time Error
c) Aditya Aditya Aditya
d) Aditya Sudheer Sudheer
e) Aditya Sudheer Nikhil
Ans :- C

8) #include
#include
int main(){
char *ptr1 = NULL;
char *ptr2 = 0;
printf("\n%d %d",ptr1,ptr2);
return 0;
}
A) NULL NULL
B) 0 0
C) Compile Time Error
D) Run Time Error
Ans:- B
9) #include
#include
int main(){
char *c="123\08";
printf("%s",c);
return 0;
}
A) 12308
B) 1238
C) 123
D) None of these
Ans:- C
10) #include
int main(){
int array[]={10,20,30,40};
printf("%d",2[-array]);
return 0;
}
(A) -60
(B) -30
(C) 60
(D) Garbage value
(E) Compiler error
Ans:- E
11)
#include
int main()
{ char *p="KMIT";
*p='H';
printf("%s",p);
return 0;
}
A) KMIT
B) HMIT
C) Compile Time Error
D) Run Time Error
Ans:- B
12)
int x;
void p(void)
{ int r=2; printf("%d",r); printf("%d",x); }
void r(void)
{ x=1; p(); }
void q(void)
{ int x=3; r(); p(); }
void main()
{ p(); q(); }
A) 2,0,2,1,3,1 B) 3,0,2,1,3,1
C) 2,0,2,1,2,1 D) 2,0,3,1,2,1
Ans:- C

13) #include
void main()
{
char c[]="KMIT2013";
char *p=c;
printf("%s",p+p[3]-p[1]);
}
A) MIT2013
B) 3
C) 2
D) IT2013
Ans:- B

14) #include
int main(){
int arr[]={6,12,18,24};
int x=0;
x=arr[1]+(arr[1]=2); //Line A
printf("%d",x);
return 0;
}
A) 14
B) 24
C) 4
D) Compile Time Error at Line A

Ans:- C
15) What will be output of following c code?
void main()
{
struct employee
{
unsigned id: 8;
unsigned sex:1;
unsigned age:7;
};
struct employee emp1={203,1,23};
clrscr();
printf("%d\t%d\t%d",emp1.id,emp1.sex,emp1.age);
getch();
}
A) Compile Time Error
B) Run Time Error
C) 8 1 7
D) None of these

Ans:- D

Wednesday 16 January 2013

print the alternate charecters in the original string using pointers

// output: w l o e t mt
#include
void alternater(char*,char*);
void main()
{
char str[20]="welcome t kmit";
char res[10];
alternater(str,res);
printf("%s",res);
}
void alternater(char *org,char *astr){
int i,j,n;
n=strlen(org);
for(i=0,j=0;j {
astr[i]=org[j];
}
astr[i]='\0';
}

Example on Nested Structure in c

#include
struct Addr
{
int streetno;
char city[10];
char state[20];
int zipcode;
};
struct Student
{ int rno;
char sname[20];
int smarks;
int age;
struct Addr a;
};
struct Student carr[]={{1,"Fasi",100,50,
{10,"Hyderabad,"Telengana",500027}}};
void main()
{
struct Student *sptr;
struct Addr b={15,"Vizag","Andhra",500058};
sptr=carr;
sptr->a=b;
printf("%s",sptr->a.state);
}

Thursday 3 January 2013

interview questions in java

1. What is the difference between an Interface and an Abstract class?
2. What is the purpose of garbage collection in Java, and when is it used?
3. Describe synchronization in respect to multithreading.
4. Explain different way of using thread?
5. What are pass by reference and passby value?
6. What is HashMap and Map?
7. Difference between HashMap and HashTable?
8. Difference between Vector and ArrayList?
9. What is the difference between a constructor and a method?
10. What is an Iterator?
11. State the significance of public, private, protected, default modifiers
both singly and in combination and state the effect of package
relationships on declared items qualified by these modifiers.
12. What is an abstract class?
13. What is static in java?
14. What is final?
15. What if the main method is declared as private?
16. What if the static modifier is removed from the signature of the main method?
17. What if I write static public void instead of public static void?
18. What if I do not provide the String array as the argument to the method?
19. What is the first argument of the String array in main method?
20. If I do not provide any arguments on the command line, then the String
array of Main method will be empty or null?
21. How can one prove that the array is not null but empty using one line
of code?
22. What environment variables do I need to set on my machine in order to
be able to run Java programs?
23. Can an application have multiple classes having main method?
24. Can I have multiple main methods in the same class?
25. Do I need to import java.lang package any time? Why ?
26. Can I import same package/class twice? Will the JVM load the package
twice at runtime?
27. What are Checked and UnChecked Exception?
28. What is Overriding?
29. What are different types of inner classes?
30. Are the imports checked for validity at compile time? e.g. will the
code containing an import such as java.lang.ABCD compile?
31. Does importing a package imports the subpackages as well?
e.g. Does importing com.MyTest.* also import com.MyTest.UnitTests.*?
32. What is the difference between declaring a variable and defining a variable?
33. What is the default value of an object reference declared as an
instance variable?
34. Can a top level class be private or protected?
35. What type of parameter passing does Java support?
36. Primitive data types are passed by reference or pass by value?
37. Objects are passed by value or by reference?
38. What is serialization?
39. How do I serialize an object to a file?
40. Which methods of Serializable interface should I implement?
41. How can I customize the seralization process? i.e. how can one
have a control over the serialization process?
42. What is the common usage of serialization?
43. What is Externalizable interface?
44. When you serialize an object, what happens to the object references
included in the object?
45. What one should take care of while serializing the object?
46. What happens to the static fields of a class during serialization?
47. Does Java provide any construct to find out the size of an object?
48. Give a simplest way to find out the time a method takes for
execution without using any profiling tool?
49. What are wrapper classes?
50. Why do we need wrapper classes?
51. What are checked exceptions?
52. What are runtime exceptions?
53. What is the difference between error and an exception?
54. If my class already extends from some other class what should
I do if I want an instance of my class to be thrown as an exception object?
55. How does an exception permeate through the code?
56. What are the different ways to handle exceptions?
57. What is the basic difference between the 2 approaches to exception handling.
1> try catch block and
2> specifying the candidate exceptions in the throws clause?
When should you use which approach?
58. Is it necessary that each try block must be followed by a catch block?
59. If I write return at the end of the try block, will the finally block
still execute?
60. If I write System.exit (0); at the end of the try block, will the finally
block still execute?
61. How are Observer and Observable used?
62. What is synchronization and why is it important?
63. How does Java handle integer overflows and underflows?
64. Does garbage collection guarantee that a program will not run out of memory?
65. What is the difference between preemptive scheduling and time slicing?
66. When a thread is created and started, what is its initial state?
67. What is the purpose of finalization?
68. What is the Locale class?
69. What is the difference between static and non-static variables?
70. How are this() and super() used with constructors?
71. What are synchronized methods and synchronized statements?
72. What is daemon thread and which method is used to create the daemon thread?
73. What are the steps in the JDBC connection?
74. How does a try statement determine which catch clause should be used
to handle an exception?
75. Can an unreachable object become reachable again?
76. What method must be implemented by all threads?
77. What are synchronized methods and synchronized statements?
78. What is Externalizable?
79. What modifiers are allowed for methods in an Interface?
80. What are some alternatives to inheritance?
81. What does it mean that a method or field is "static"?
82. What is the catch or declare rule for method declarations?
83. Is Empty .java file a valid source file?
84. Can a .java file contain more than one java classes?
85. Is String a primitive data type in Java?
86. Is main a keyword in Java?
87. Is next a keyword in Java?
88. Is delete a keyword in Java?
89. Is exit a keyword in Java?
90. What happens if you dont initialize an instance variable of
any of the primitive types in Java?
91. What will be the initial value of an object reference which is
defined as an instance variable?
92. What are the different scopes for Java variables?
93. What is the default value of the local variables?
94. How many objects are created in the following piece of code?
MyClass c1, c2, c3;
c1 = new MyClass ();
c3 = new MyClass ();
95. Can a public class MyClass be defined in a source file named YourClass.java?
96. Can main method be declared final?
97. What will be the output of the following statement?
System.out.println ("1" + 3);
98. What will be the default values of all the elements of an array
defined as an instance variable?

Important questions in pointers

1. What does static variable mean?
2. What are the differences between malloc() and calloc()?
3. What is the difference between strings and character arrays?
4. Difference between const char* p and char const* p?
5. Can static variables be declared in a header file?
6. How can you determine the size of an allocated portion of memory?
7. When does the compiler not implicitly generate the address of the
first element of an array?
8. What is a null pointer?
9. What is static memory allocation and dynamic memory allocation?
10. How are pointer variables initialized?
11. Difference between arrays and pointers?
12. Is using exit() the same as using return?
13. What is indirection?
14. What is modular programming?
15. What is the difference between declaring a variable and defining a variable?
16. What is an lvalue?
17. Differentiate between an internal static and external static variable?
18. What is the difference between a string and an array?
19. What is an argument? Differentiate between formal arguments
and actual arguments?
20. What are advantages and disadvantages of external storage class?
21. What is a void pointer?
22. When should a type cast not be used?
23. When is a switch statement better than multiple if statements?
24. What is a static function?
25. What is a pointer value and address?
26. What is a modulus operator? What are the restrictions of a modulus operator?
27. Differentiate between a linker and linkage?
28. What is a function and built-in function?
29. Why should I prototype a function?
30. What do you mean by normalisation of pointers?