Languages-Java [3i Infotech Placement]: Sample Questions 107 - 108 of 141

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 107

Edit

Write in Short

Short Answer▾

Parameters in c passed by________

Explanation

  • Parameters in c passed by value.
  • When a single value is passed to a function via an actual argument.
  • The value of the actual argument is copied into the function.
  • So, the value of the corresponding formal argument can be altered within the function, but the value of the actual argument within the calling routine will not change.
  • This procedure for passing the value of an argument to a function is known as passing by value.

Question 108

Appeared in Year: 2004

Question

MCQ▾

Which of the following JSP expressions are valid?

Choices

Choice (4)

a.

<% = “Sorry” + “for the” + “break” %>

b.

<% = “Sorry” ; %>

c.

<% = “Sorry” %>

d.

Both c. and a. are correct

Answer

d.

Explanation

  • Code placed within JSP expression tag is written to the output stream of the response.
  • So there is no need to write out. print () to write data.
  • The value of an expression inside JSP expression is converted to a String.
  • We can use an expression within a line of text, whether or not it is tagged with HTML, in a JSP file.
  • The expression element can contain any expression that is valid according to the Java Language Specification but we cannot use a semicolon to end an expression.

Syntax of JSP extension:

<% = Expression %>

Example:

  1. <html>
  2. <body>
  3. <%=”welcometojsp” %>
  4. </body>
  5. </html>
  • So, the correct answer is <% = “Sorry” + “for the” + “break” %> and <% = “Sorry” %> .

Developed by: