Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
Java Question:
1. What will be the output of the following program?
class A
{
static int i = 1111;
static
{
i = i-- - --i;
}
{
i = i++ + ++i;
}
}
class B extends A
{
static
{
i = --i - i--;
}
{
i = ++i + i++;
}
}
public class MainClass
{
public static void main(String[] args)
{
B b = new B();
System.out.println(b.i);
}
}
2. What happens when you call methodOfA() in the below class?
class A
{
int methodOfA()
{
return (true ? null : 0);
}
}
3. What will be the output of the following program??
public class MainClass
{
public static void main(String[] args)
{
int i = 10 + + 11 - - 12 + + 13 - - 14 + + 15;
System.out.println(i);
}
}
4. Which statements in the below class shows compile time error (Line 5 or
Line 7 or both)?
public class MainClass
{
public static void main(String[] args)
{
Integer i = new Integer(null);
String s = new String(null);
}
}
Checked and Unchecked Exceptions?
Questions on shift operators?
1. >> and >>>
2. == and equals()
5. Assertions in java
6. What are inner class and anonymous class?
Database:
1. Normalization with ex?
2. Complex queries:
Finding maximum value without using aggregate function
Retrieve unique rows without using distinct.
Find nth highest salary?
3. How to create database link?
4. SQL Injection
5. How to remove only one column values from the duplication of values in
that column without using any other column references in that table?
6. What is the difference between logical and virtual memory in databases
7. What is the difference between ROWNUM pseudo column and
ROW_NUMBER() function?
8. How will you copy the structure of a table without copying the data?
9. What are "HINTS"? What is "index covering" of a query?
10. What is a VIEW? How to get script for a view?
C Questions:
Predict Output on:
1. Pointers?
2. Operators
a. shift >> <<
b. increment decrement operators
3. Command Line Arguments?
4. Multidimensional arrays to get address of data.
1. main( )
{
static int a[ ] = {0,1,2,3,4};
int *p[ ] = {a,a+1,a+2,a+3,a+4};
int **ptr = p;
ptr++;
printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr);
*ptr++;
printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr);
*++ptr;
printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr);
++*ptr;
printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr);
}
2. main ( )
{
static char *s[ ] = {“black”, “white”, “yellow”, “violet”};
char **ptr[ ] = {s+3, s+2, s+1, s}, ***p;
p = ptr;
**++p;
printf(“%s”,*--*++p + 3);
}
3. What will be output when you will execute following c code?
#include<stdio.h>
void main(){
int const SIZE=5;
int expr;
double value[SIZE]={2.0,4.0,6.0,8.0,10.0};
expr=1|2|3|4;
printf("%f",value[expr]);
}
4. #include<stdio.h>
enum power{
Dalai,
Vladimir=3,
Barack,
Hillary
};
void main(){
float leader[Dalai+Hillary]={1.f,2.f,3.f,4.f,5.f};
enum power p=Barack;
printf("%0.f",leader[p>>1+1]);
}
5. #include<stdio.h>
#define var 3
void main(){
char *cricket[var+~0]={"clarke","kallis"};
char *ptr=cricket[1+~0];
printf("%c",*++ptr);
}
6. What will be output when you will execute following c code?
#include<stdio.h>
union group{
char xarr[2][2];
char yarr[4];
};
void main(){
union group x={'A','B','C','D'};
printf("%c",x.xarr[x.yarr[2]-67][x.yarr[3]-67]);
}