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

Languages
Edit

Write in Short

Short Answer▾

Why do you use canvas?

Explanation

  • Canvas represents a blank rectangular area where the application can draw or trap input events from the user.
  • An application must subclass the canvas in order to get useful functionality creating a custom component.
  • The paint method is overridden in order in order to perform custom graphics on the canvas.

Declaration class:

public class Canvas

extends Component

implements Accessible

Question 471

Edit

Describe in Detail

Essay▾

Which type of architecture does 8085 have?

Explanation

Define Architecture of 8085
  • It is based on von-Neumann architecture where data and instructions are in the same memory space without any distinction between them.
  • is complex instruction set computer.
  • It is a -bit processor with 8 bit data bus.
  • It has address lines.
  • Maximum operating speed is MHz.

Question 472

Edit

Describe in Detail

Essay▾

Predict the output or error (s) for the following:

  1. main ()
  2. {
  3.     inta =10, ⚹j;
  4.     void ⚹k;
  5.     j =k =&a;
  6.     j ++;
  7.     k ++;
  8.     printf ( “ %u %u”, j, k);
  9. }

Explanation

  • In the program
Table Showing the Program
int a = 10, ⚹ j;
  • Define the integer variable a = 10 and pointer j
void ⚹ k;
  • Define the void pointer k
j = k = &a;
  • Address of a is stored in j and k
j ++ ;
  • Increment the j value.
k ++ ;
  • Increment the k value
  • But void pointers are generic and are used only when the type is not known and as an intermediate address storage type.
  • No pointer arithmetic can be done on them and program cannot apply indirection operator (⚹) on void pointers.

Developed by: