Languages [3i Infotech Placement]: Sample Questions 210 - 211 of 546

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 210


Describe in Detail


What is the output of the following program?

  1. main() {
  2.     charc =‘’, x, convert(z);
  3.     getc(c);
  4.     if((c >= ‘a’) && (c ? ‘z’))
  5.         x =convert(c);
  6.     printf(“ %c” x);
  7. }
  8. convert(z)
  9. {
  10.     returnz -32;
  11. }


Compiler error

In the program

Table Shows the Program
char c = ‘’ , x, convert (z) ;Define the char c = blank space, declare x variable and convert (z) function with char return.
getc (c) ;Call getc () function but it՚s format is wrong

The declaration for get () function is int getc (FILE ⚹ stream)

if ( (c >= ‘a’ ) && (c⇐ ‘z’ ) )Define the if condition
x = convert (c) ;Definition of convert does not match declaration.

Question 211


Describe in Detail


What is serialization?


Understanding of Serialization
  • Serialization is a mechanism of converting the state of an object into a type stream.
  • It is used in Hibernate, RMI, EJB and JMS technologies.
  • An object is thus represented as a sequence of bytes that includes the object՚s data as well as information about the object՚s type and the types of data stored in the object.

Advantages of java serialization:

Mainly used to send object՚s state on the network.

Developed by: