Languages [3i Infotech Placement]: Sample Questions 448 - 450 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 448

Edit

Write in Short

Short Answer▾

Is the following code legal?

  1. structa
  2. {
  3.     intx;
  4.     structab;
  5. }

Explanation

  • It is not legal for a structure to contain a member that is of the sametype as in this case.
  • Because this will cause the structure declaration to be recursive without end.
  • It is ok for structure to contain a pointer to itself.

Question 449

Edit

Describe in Detail

Essay▾

What is the difference between class and structure?

Explanation

Difference between Class and Structure
ClassStructure
Can inherit from another class.Does not support inheritance.
Supports all types of constructor and destructor.Supports only the parameterized constructor.
Members of class can be initialized directly.Members of structure cannot initialize directly.
Not created without using the new keyword.It can be created without using the new keyword.

Question 450

Languages
Edit

Write in Short

Short Answer▾

What are the benefits of using swing over AWT?

Explanation

  • Provides both additional components and added functionality to AWT-replacement components.
  • Changes appearance based on the current “look and feel” of library being used.
  • Allows lightweight components- components are lightly dependent on underlying domain.
  • Better support for multi-threading.
  • Built on the MVC model- model-view-controller paradigm (MVC) can provide more flexible UI.

Developed by: