Sie sind auf Seite 1von 4

INTERNAL EXAMINATION (IT-1)

Java Programming and XML


Curriculum-6607
Total Marks: 20
60min

Total Questions: 26

Duration:

Q1. The standard input/output stream in java is presented by which of the following fields of the
System class
a) In
b) out
c) sys
d) err
( Book = Guide to advance java , Session = Input / Output Stream , Topic
=stream Classes

Q2. Which of the following is not a type of quantifier?


a) greedy
b) reluctant
c) possessive
d) None of above
Q3. Which of the following are the categories of Annotations?
a) Marker Annotations
b) Single-value Annotations
c) Full Annotations
d) All of above
Book = Guide to advance java , Session

= Annotations,

Topic =Annotation

Classes

Q4. Advantages of static methods.


a) Static methods can be invoked by using the class name directly
b) Static methods can be used to implement behaviors that are not influenced the state of any
instances.
c) Static methods cannot be redefined in instances
d) Static methods can be accessed by using the dot operator with an instance of the
class.
Q5. A _____________ variable when declared as an instance variable is accessible throughout the class.
a) Instance
b) Local
c) Reference
Q6. The ____________ allows an overriding method to return an object whose type is a sub-class of the
type returned by the overridden method in the superclass.
a) Covariant return types
b) Method hiding
c) Method overloading
Q7. The ___________________statement causes the current iteration of the innermost loop to stop the
next iteration of the same loop to start.
a) Break
b) Continue
c) Exit
Q8. A ______________ statement consist of a valid identifier that ends with a colon it must be placed just
before the statement being labeled.
a) Break
b) Label
c) Continue
Q9. Select the correct statements
a) Primitive variables are used to store primitive data type values.
b) Primitive instance variables are accessible throughout the class in which they have declared.
c) Primitive local variable are declared outside the methods and their scope is global.

d) Primitive variables are used to store reference to objects.

Q10. ___________ tests the correctness of assumption in a program.


a) Assertion
b) User Defined exceptions
c) Exceptions

Q11. ___________ exceptions arise due to the errors present in the APIs.
a) Programming errors
b) Client code errors
c) Errors beyond the control of a program.
Q12. __________________ literals are enclosed in a single quotes.
a) Character
b) String
c) Floating point
Q13. _____________ consists of sequence of characters enclosed in double quotes.
a) String literals
b) Null literals
c) Character literals
Q14. The primitive datatype _________ represents symbols in a character set like letters and numbers.
a) byte
b) char
c) short
d) long
Q15: Which of the following statements stating the characteristics of Deque are true?
a) Is a double ended queue allowing insertion and deletion of elements from both ends
b) Can be implemented only as queue
c) Deque defines only free size deques
d) Deque defines two forms of methods.
Q16. Java provides some statements that will change the flow of control based on conditions.
__________ statement stops the execution of the innermost loop in the program and starts processing
the next line of code after the block.
a) break
b) continue
c) change
d) jump
Q17. The ____________ statement causes the current iteration of the innermost loop to cease and the
next iteration of the same loop to start.
a) continue
b) break
c) end
d) cease
Q18. ________________ usually tests the loop control variable against a targeted value in a FOR
statement.
a) Boolean expression
b) Initialization expression
c) Iteration expression
Q20. What is known as a base case?
a) Stopping recursion to save the memory
b) Calling a recursive method
c) Creating actual objects
d) Assigning values to elements
Q21. Every recursive method has some characteristics. When the method calls itself and pushes
values on the stack, then this phase is known as ____________

a) Endless recursion
b) Recursive depth
c) Stack overflow
d) Winding
Q22. What will be the result of trying to compile and run the expression (int)(Math.random()*4)?
a) A negative number might be returned.
b) The number 0 might be returned.
c) The number 4 is returned
d) The probability that the number 0, 1, 2, or 3 might be returned is equal.

Q23. Which expression will extract the substring cas from the string defined by the String str =
cacaso,
a) Str.substring(2,3)
b) Str.substring(2,2)
c) Str.substring(2,5)
d) Str.substring(3,2)
Q24. Which of the following class is associated with the primitive data type float?
a) Float
b) Integer
c) Character
d) All of above
Q25. ________________ calculates the absolute value of the int, long, float, or double value passed to it
as argument.
a) abs()
b) ceil()
a) floor()
b) min()
Q26. The OjectOutputSteam class serializes Java objects.
a) TRUE
b) FALSE

Das könnte Ihnen auch gefallen