Languages [3i Infotech Placement]: Sample Questions 473 - 475 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 473
Write in Short Short Answer▾
What is the output of the following program?
main ()
{
unsigned char i =0;
for (; i>= 0; i ++ );
printf ( “%d” i);
}
Explanation
- Define the unsigned char
- Unsigned character represents only + ve value from 0 to 255.
unsigned char i = 0; |
|
for (; i >= 0; i ++) ; |
|
printf ( “% d” i) ; |
|
Question 474
Describe in Detail Essay▾
What modifiers may be used with an inner class that is a member of an outer class?
EditExplanation
- Inner classes is a full-fledged member of the enclosing class.
- Can be marked with any access modifier including abstract or final modifiers.
- But an inner class cannot contain any static members.
Syntax of Inner Class
Class outer_demo
{
Class nested_demo
{
}
}
Question 475
Explanation
- Four concepts for OOAD are.
- Abstraction -grouping of data and behavior (operations) into a conceptual object.
- Encapsulation -Implementation mode of data abstraction with encapsulation to accomplish data hiding
- Polymorphism -Process by which object invokes a method of another object in a common manner (with the same name) without understanding or caring how it is accomplished.
- Inheritance-Object derived from another object inherits all the properties etc