Which of the following statements regarding the wait() method are correct? choose three
It is an instance method of Object class.
It is a static method of the Object class
It is an instance method of Thread class.
The Thread must have a lock on the object on which the wait() method is to be invoked
An object can have only one Thread in a waiting state at a time
It must be called in a synchronized code
Which of the following statements are true about synchronization? choose two
Static methods cannot be synchronized
Synchronized methods cannot make calls to non-synchronized methods
A synchronized method can be overridden to be non-synchronized and vice versa
When a thread is executing a synchronized method, other threads can freely access non-synchronized methods of the same object
char * Name[] = { "Ritesh", "Kumar" "Singh", "Happy", "Bittoo" "Roshan", "Go", }; How many elements does the array dwarves (declared above) contain?
4
5
6
7
void Free( struct node *ptr ) { while( ptr) { ???? } } Which one of the following can replace the ???? for the function above to release the memory allocated to a linked list?
n = n->next; free( n );
struct node m = n; n = n->next; free( m );
free( n ); n = n->next;
struct node m = n; free( m ); n = n->next;
int n = 0; for ( ; ; ) { if (n++ == 5) break; continue; } printf("x=%d\n", x); What will be printed when the sample code above is executed?
1
2
struct customer *p= malloc( sizeof( struct customer ) ); Given the sample allocation for the pointer "p" found above, which one of the following statements is used to reallocate ptr to be an array of 10 elements?
p = realloc( ptr, 10 * sizeof( struct ritesh));
realloc( ptr, 9 * sizeof( struct ritesh) );
p+= malloc( 9 * sizeof( struct ritesh) );
p = realloc( ptr, 9 * sizeof( struct ritesh) );
Which one of the following will declare a pointer to an integer at address 0x100 in memory?
int *p; *p = 0x200;
int *p = &0x200;
int *p = *0x200;
int *p = 0x200;
Sockets provide an interface for programming networks in which layer?
Application
Network
Transport
Physical
Socket – based communication is programming language independent.
True
False
Using which class,A server can be implemented?
Server in java.net package
ServerSocket in java.util.package
Server in java.util package
ServerSocket in java.net package