0% found this document useful (0 votes)
17 views

MCQ Adv

Uploaded by

Ritam Saha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

MCQ Adv

Uploaded by

Ritam Saha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Level-2

1. Which component is used to compile, debug b) throw


and execute the java programs? c) catch
a) JRE d) try
b) JIT 8. What is the range of short data type in Java?
c) JDK a) -128 to 127
d) JVM b) -32768 to 32767
2. Which of these cannot be used for a variable c) -2147483648 to 2147483647
name in Java? d) None of the mentioned
a) identifier & keyword 9. What is the range of byte data type in Java?
b) identifier a) -128 to 127
c) keyword b) -32768 to 32767
d) none of the mentioned c) -2147483648 to 2147483647
3. What is the extension of java Byte code d) None of the mentioned
files? 10. An expression involving byte, int, and literal
a) .js numbers is promoted to which of these?
b) .txt a) int
c) .class b) long
d) .java c) byte
4. Which environment variable is used to set d) float
the java path? 11. What is the numerical range of a char data
a) MAVEN_Path type in Java?
b) JavaPATH a) -128 to 127
c) JAVA b) 0 to 256
d) JAVA_HOME c) 0 to 32767
5. What is not the use of “this” keyword in d) 0 to 65535
Java? 12. Which of these coding types is used for data
a) Referring to the instance variable when a type characters in Java?
local variable has the same name a) ASCII
b) Passing itself to the method of the same b) ISO-LATIN-1
class c) UNICODE
c) Passing itself to another method d) None of the mentioned
d) Calling another constructor in constructor 13. Which of these is long data type literal?
chaining a) 0x99fffL
6. Which of these are selection statements in b) ABCDEFG
Java? c) 0x99fffa
a) break d) 99671246
b) continue 14. Which of these is necessary condition for
c) for() automatic type conversion in Java?
d) if() a) The destination type is smaller than
7. Which of these keywords are used for the source type
block to be examined for exceptions? b) The destination type is larger than source
a) check type
c) The destination type can be larger or 22. What should be expression1 evaluate to in
smaller than source type using ternary operator as in this line?
d) None of the mentioned expression1 ? expression2 : expression3
a) Integer
15. What is Truncation in Java?
b) Floating – point numbers
a) Floating-point value assigned to an c) Boolean
integer type d) None of the mentioned
b) Integer value assigned to floating type
c) Floating-point value assigned to a 23. Which of these selection statements test only
Floating type for equality?
d) Integer value assigned to an integer type a) if
16. Which of these operators is used to allocate b) switch
memory to array variable in Java? c) if & switch
a) malloc d) none of the mentioned
b) alloc 24. Which of these jump statements can skip
c) new processing the remainder of the code in its
d) new malloc body for a particular iteration?
17. Which of these is necessary to specify at a) break
time of array initialization? b) return
a) Row c) exit
b) Column d) continue
c) Both Row and Column 25. What is true about a break?
d) None of the mentioned a) Break stops the execution of entire
18. Which of the following can be operands of program
arithmetic operators? b) Break halts the execution and forces the
a) Numeric control out of the loop
b) Boolean c) Break forces the control out of the loop
c) Characters and starts the execution of next iteration
d) Both Numeric & Characters d) Break halts the execution of the loop for
19. What is the output of relational operators? certain time frame
a) Integer 26. From where break statement causes an exit?
b) Boolean a) Only from innermost loop
c) Characters b) Terminates a program
d) Double c) Only from innermost switch
20. Which of these operators can skip evaluating d) From innermost loops or switches
right hand operand? 27. When does method overloading is
a) ! determined?
b) | a) At run time
c) & b) At compile time
d) && c) At coding time
21. Which of these statements is correct? d) At execution time
a) true and false are numeric values 1 and 0 28. Which concept of Java is achieved by
b) true and false are numeric values 0 and 1 combining methods and attribute into a
c) true is any non zero value and false is 0 class?
d) true and false are non numeric values a) Encapsulation
b) Inheritance
c) Polymorphism c) main()
d) Abstraction d) none of the mentioned
29. Which component is used to compile, debug 36. What would be the behaviour if this() and
and execute java program? super() used in a method?
a) JVM a) Runtime error
b) JDK b) Throws exception
c) JIT c) compile time error
d) JRE d) Runs successfully
30. Which component is responsible for 37. Which of these is used to access a member
converting bytecode into machine specific of class before object of that class is
code? created?
a) JVM a) public
b) JDK b) private
c) JIT c) static
d) JRE d) protected
31. Which component is responsible to run java 38. All the variables of class should be ideally
program? declared as?
a) JVM a) private
b) JDK b) public
c) JIT c) protected
d) JRE d) default
32. Which component is responsible to 39. What is true of final class?
optimize bytecode to machine code? a) Final class cause compilation failure
a) JVM b) Final class cannot be instantiated
b) JDK c) Final class cause runtime failure
c) JIT d) Final class cannot be inherited
d) JRE 40. Which is the modifier when there is none
33. What is the process of defining more than mentioned explicitly?
one method in a class differentiated by a) protected
method signature? b) private
a) Function overriding c) public
b) Function overloading d) default
c) Function doubling 41. Which of these keywords is used to prevent
d) None of the mentioned content of a variable from being modified?
34. Which keyword is used by the method to a) final
refer to the object that invoked it? b) last
a) import c) constant
b) catch d) static
c) abstract 42. Which of the following statements are
d) this incorrect?
35. Which function is used to perform some a) static methods can call other static
action when the object is to be destroyed? methods only
a) finalize() b) static methods must only access static
b) delete() data
c) static methods can not refer to this or
super in any way b) Stack
d) when object of class is declared, each c) Queue
object contains its own copy of static d) Tree
variables 50. Which of these will happen if recursive
43. Which of these method of String class is method does not have a base case?
used to obtain character at specified index? a) An infinite loop occurs
a) char() b) System stops the program after some time
b) Charat() c) After 1000000 calls it will be
c) charat() automatically stopped
d) charAt() d) None of the mentioned
44. Which of these keywords is used to refer to
member of base class from a subclass?
a) upper
b) super
c) this
d) none of the mentioned
45. Which of these method of String class can
be used to test to strings for equality?
a) isequal()
b) isequals()
c) equal()
d) equals()
46. Which of these can be used to differentiate
two or more methods having the same
name?
a) Parameters data type
b) Number of parameters
c) Return type of method
d) All of the mentioned
47. Which of these data types is used to store
command line arguments?
a) Array
b) Stack
c) String
d) Integer
48. How many arguments can be passed to
main()?
a) Infinite
b) Only 1
c) System Dependent
d) None of the mentioned
49. Which of these data types is used by
operating system to manage the Recursion in
Java?
a) Array

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy