Note:- When a class is marked with objectpooling attribute it can not be inherited.
ObjectPooling(MinPoolSize := 2, MaxPoolSize := 5, CreationTimeout := 20000)> _
Public Class testingclass
Note:- When a class is marked with objectpooling attribute it can not be inherited.
ObjectPooling(MinPoolSize := 2, MaxPoolSize := 5, CreationTimeout := 20000)> _
Public Class testingclass
char *p="hai friends",*p1;
p1=p;
while(*p!='\0') ++*p++;
printf("%s %s",p,p1);
ibj!gsjfoet
---- A number of channels in one bus
---- e.g. 32 bit data bus is 32 separate single bit channels
---- Remember that there is no difference between “data” and “instruction” at this level.
---- 8, 16, 32, 64 bit
byte b = 5;
byte c = 4;
byte d = b + c; // does not compile because int cannot fit in a byte
float f = (float)35.67; // implicitly double, so casting to float
float f = 35.67F;
Add reference to EnterpriseServices.
static int i;
static public void main(String[] args)
{
do
{
System.out.println(args[++i]);
} while (i < args.length);
}
---Indicated by an interrupt signal
---Suspend execution of current program
011
0x0001;
Note:- Even though VB6 and V C++ has gone off still many people do ask these old questions again and again. Still there are decent old application which are working with COM very much fine. So interviewer still asks you these questions so that those application’s can be ported to .NET. So let’s play some old music...
int i;
i = 64/square(4);
printf("%d",i);
64
int i=5;
printf("%d%d%d%d%d%d",i++,i--,++i,--i,i);
45545
printf("\nab");
printf("\bsi");
printf("\rha");
hai
interface MyInterface
{
void f();
}
class MyClass implements MyInterface
{
public void f() {}
}
cout<<ptr[0];
cout<<ptr[0];
int a[size] = {1,2,3,4,5};
int *b = new int(size);
print(a);
print(b);
int a, *pa, &ra;
pa = &a;
ra = a;
cout <<"a="<<a <<"*pa="<<*pa <<"ra"<<ra ;
Compiler Error: 'ra',reference must be initialized
while (*str = 0) /* programmer meant to write *str != 0 */
{
/* some code here */
str++;
}
What is CCW (COM callable wrapper) ?
How do we ensure that .NET components is compatible with COM ?
struct xx
{
int x;
struct yy
{
char s;
struct xx *p;
};
struct yy *q;
};
Compiler Error
public:
virtual void baseFun(){ cout<<"from base"<<endl;}
public:
void baseFun(){ cout<< "from derived"<<endl;}
baseObj->baseFun();
base baseObject;
SomeFunc(&baseObject);
deri deriObject;
SomeFunc(&deriObject);
from base
from derived
public:
void baseFun(){ cout<<"from base"<<endl;}
public:
void baseFun(){ cout<< "from derived"<<endl;}
baseObj->baseFun();
base baseObject;
SomeFunc(&baseObject);
deri deriObject;
SomeFunc(&deriObject);
from base
from base
public class TutorialGC
{
public static void main(String [] args)
{
Object a = new Integer(100); // Line1
Object b = new Long(100); // Line2
Object c = new String("100"); // Line3
a = null; // Line4
a = c; // Line5
c = b; // Line6
b = a; // Line7
// Rest of the code here
}
}
struct xx
{
int x=3;
char name[]="hello";
};
struct xx *s;
printf("%d",s->x);
printf("%s",s->name);
Compiler Error
int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} };
int *p,*q;
p=&a[2][2][2];
*q=***a;
printf("%d----%d",*p,*q);
Binom = 1
Binom=(bimom*(f-x+1)/x
Printf binom
Else
Goto 5
Note :- You can get the source code in CD in “CodeDom” folder.
We will try to generate the following code below. The below code
char s[]={'a','b','c','\n','c','\0'};
char *p,*str,*str1;
p=&s[3];
str=p;
str1=s;
printf("%d",++*p + ++*str1-32);
77
int i=10;
i=!i>14;
Printf ("i=%d",i);
i=0
int i = 3;
switch (i)
{
default:
System.out.println("default");
case 0:
System.out.println("zero");
case 1:
System.out.println("one");
break;
case 2:
System.out.println("two");
}
assert(a > 0); // throws an AssertionError if a <= 0
assert Expression1 ;
assert Expression1 : Expression2 ;
4.1 printf "Month of sales is : 02/87”
4.2 printf "Price is : 75,000"
5.1 print "Month of sales is : 07/87 "
5.2 print "Price is : 95,000”
6.1 print "Month of sales is : 04/88 "
6.2 print " Price is : 1,10,000"
7.2 print " Price is : 85,000"
Step1: Start
Step2: Read the value of x.
Step3: if (x>0) y-1 else if (x=0) y=0 else x<0) y=-1
Step4: Print y
Step5: Stop.
Step1: Start
Step2: Read the values of x,y and a.
Step3: p=2.5*log(x)+ cos(a*3.14/180)+sqrt(2*x*y)+(x*x-y*y)
Step4: Print p
Step5: Stop.
int i =0;
MessageBox.Show(i.ToString());
MessageBox.Show(Convert.ToString(i));
public:
int bval;
base(){ bval=0;}
public:
int dval;
deri(){ dval=1;}
for(int i=0; i<size; i++,arr++)
cout<<endl;
base BaseArr[5];
SomeFunc(BaseArr,5);
deri DeriArr[5];
SomeFunc(DeriArr,5);
00000
01010
{
ptr = new int(i);
{
delete ptr;
{
cout << "The value is " << *ptr;
cout << "Say i am in someFunc " << endl;
Sample s1= 10;
SomeFunc(s1);
s1.PrintVal();
Say i am in someFunc
Null pointer assignment(Run-time error)