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

Edit

Write in Short

Short Answer▾

Out of fgets () and gets () which function is safe to use and why?

Explanation

  • The fgets () function is safer to use.
  • Checks the bounds- the size of the buffer and prevents overflow on the stack.
  • The gets () function does not check the bounds.
  • The gets () function is insecure and lead to errors and security vulnerabilities.

Question 253

Edit

Describe in Detail

Essay▾

Can link and Association applied interchangeably?

Explanation

  • No, link represents the relationship between the two objects.
  • But Association is used represent the relationship between the two classes. link:: student: Abhilash course: MCA Association:: student course
  • Association is a relationship among classes and link is a relationship among instance of classes.
  • e. g. ⩾ Person works for company.
  • Connection between two classes ‘person’ and ‘company’ is an example of association. One instance of each of the above classes like ‘Ram’ and ‘Google’ will have a “link” : Ram is working for Google.
  • We can՚t use ‘Person works as a programmer for Google’ .

Question 254

Languages
Edit

Describe in Detail

Essay▾

What are abstract class?

Explanation

Understanding of Abstract Class
  • A class that is declared with abstract keyword, is known as abstract class.
  • They are called interfaces.
  • It can abstract and non-abstract methods.
  • We cannot instantiate them, and they contain methods declared with or without an implementation.
  • In interfaces, all fields are automatically public, static and final and all methods are public.

Developed by: