728x90 AdSpace

Trending

Interview Questions


  • How does free() know how much memory to release .....?

            Ans: Whenever we call malloc() for memory it allocates memory in heap area and value of the starting address is stored in a virtual memory tables.So whenever free() is called then using the starting memory location free () will have an entry of the bytes allocated and to be freed. It can do it using this entry then entry is deleted also.This is pure OS concept.


  • Guess the output......!

int main()
{
int a;
int b;
b=(3,2,1);
a=1,2,3;
a=a+b;
printf("a=%d , b=%d ",a,b);//4,3
return 0;
}
reason:
The comma operator has left-to-right associativity. Two expressions separated by a comma are evaluated left to right.
a=1,2,3;
Comma operator has lowest precedence than assignment operator.
so assignment statement will be executed first.
b=(1,2,3);
bracket has highest priority than any operator.so comma operaor will return right most operand.

  • Difference between final, finally and finalizer in java
  1. final keyword can be used along with variable, method and Class in Java.If you make a variable final, you can not change it's value, it will act like a constant. final variables are initialized at the time of creation except in case of blank final variable which is initialized in Constructor. If you make a method final in Java, you can not override it in sub class . If you make a class final means it can not be sub classed. Making a class final automatically makes all its method final 
  2. finally is used for exception handling along with try and catch.
  3. finalize() is a method, finalize() is called by Garbage collection thread just before collecting eligible Objects.



Write your opinion....!
Interview Questions Reviewed by Unknown on 10:09 Rating: 5 How does free() know how much memory to release .....?             Ans: Whenever we call malloc() for memory it allocates memory in he...

2 comments:

  1. I need help in advance java concepts......plz help me

    ReplyDelete
    Replies
    1. w''ll help you sir
      we are starting advance java tutorials soon
      you can follow that...!
      contact us for more details........!

      Delete