Correct Answer: Friends can be either functions or other classes The class grants friends unlimited access privileges * The declaration of the function should be preceded by the keyword 'friend' * The function definition will not use the keyword or the scope operator '::' Thus, a friend function is an ordinary function or a member of another class
3. What is the default return type of a function ?
Correct Answer: A finally block will always be executed, whether or not an exception is actually thrown Even in the case where the catch statement is missing and an exception is thrown, the finally block will still be executed Last thing to mention is that the finally block is used to release resources like I/O buffers, database connections, etc
7. How can you make sure the web application is fit for release ?
Correct Answer: 1 We can operate majority of test cases, but importantly we can make use testing techniques such as Pair-wise testing to reduce combinations, and/or model based testing to plan user journeys to ensure major functionality of web application works or not 2 We can also use analytics to get insight into what users do on the website, which page is most popular and which feature is most used by the users
8. What is the difference between Tags and HTML Elements ?
Correct Answer: * HTML elements communicate with the Browser how to represent the text * HTML elements become HTML tags when enclosed within the angular brackets as "<>"
9. Explain static and dynamic memory allocation with an example each.
Correct Answer: When amount of memory to be allocated is known beforehand ie at the the time of compilation, it is known as Static Memory Allocation Once the memory is allocated statically, it cannot be deallocated during program run So it leads to wastage of storage space Example: int A[100]; When amount of memory to be allocated is not known beforehand, rather it is determined at the time of program run, it is called Dynamic Memory Allocation It leads to efficient utilization of storage space Example: cout << " Enter number of elements: "; cin >> N; int *A = new int[N]; // dynamic memory allocation
10. Why static methods cannot access non static variables or methods?
Correct Answer: A static method cannot access non static variables or methods because static methods doesnt need the object to be accessed So if a static method has non static variables or non static methods which has instantiated variables they will no be intialized since the object is not created and this could result in an error