Languages [3i Infotech Placement]: Sample Questions 316 - 318 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 316
Explanation
- Validation can be called each time before throwing the object to the server for processing. If it returns true further processing can be done.
- This is ideal solution, but it brings overhead of code, time and effort.
Question 317
Question MCQ▾
What is the output of following block of program?
boolean var =false.
if (var =true)
{
System. Out. Println ( “TRUE” );
}
else
{
System. Out. Println ( “FALSE” );
}
Choices
Choice (4) | |
---|---|
a. | Run-time Error |
b. | True |
c. | Compilation Error |
d. | False |
Answer
b.Explanation
Boolean var = false | Declares boolean variable is false |
If (var = true) | If variable is true |
| Print true. Because variable is set to true in the if argument this command is executed |
else
| Otherwise print false. The else part is not executed |
Question 318
Describe in Detail Essay▾
Predict the output or error (s) for the following:
char ⚹someFun()
{ char ⚹temp =“string constant”; return temp; } int main() { puts(someFun()); }
Explanation
- In the program
puts (someFun () ) ; |
|
char ⚹ someFun () {char ⚹ temp = “string constant” ; return temp;} |
|