Jp Assignment 1
Jp Assignment 1
Answers
JP Assignment1
1. 1. What happens in statement2?
a) Statement2 defines the condition for executing the code of block.
b) Statement2 is executed (every time) after the code of block has been executed.
c) Statement2 is executed once before the loop starts.
d) An infinite loop
2. 2. What happens in statement1?
a) Statement1 defines the condition for executing the code of block.
b) Statement1 is executed (every time) after the code of block has been executed.
c) Statement1 is executed once before the loop starts.
d) An infinite loop
3. 3. Who is the developer of java?
a) Dennis Ritchie
b) James Gosling
c) Bjarne Stroustrup
d) Charles Babbage
4. 4. What was java name before?
a) Java
b) Javax
c) Classes & Java
d) Oak
5. 5. In which year java was developed?
a) 1991
b) 1972
c) 1979
d) 1995
6. 6. What is the extension of java?
a) .gt
b) .oak
c) .java
d) .javac
7. 7. Java was developed by _____________.
a) Sun Micro System
b) Oracle
c) Microsoft
d) ANSI
8. 8. Which of the following are the flavors of java?
a) J2SE
b) J2EE
c) J2ME
d) All the above
9. 9. Whose product is java right now?
a) Sun Micro System
b) Oracle
c) Microsoft
d) ANSI
10. 10. What is the first version of java?
a) JDK alpha & beta
b) JDK2.0
c) JDK15
d) All the above
11. 11. What is compilation process of java?
a) java class_name.java
b) javac class_name.java
c) javac class_name
d) class_name.java
12. 12. What is execution process of java?
a) Java class_name
b) javac class_name
c) class_name.java
d) class_name.javac
13. 13. JDK Stands for________.
a) Java developer kit
b) java design kit
c) java development kit
d) None of these
14. 14. JRE stands for__________.
a) Java running environment
b) Java runtime environment
c) Java runtime execution
d) none of these
15. 15. JVM stands for__________.
a) Java Virtual Machine
b) Java Verification Machine
c) Java Virtual Machine
d) None of these
16. 16. Which of the following is feature of java?
a) Platform Independent
b) Simple & Secure
c) Dynamic
d) All the above
17. 17. In java, System class is defined in___________.
a) java.util package
b) java.lang package
c) java.io package
d) none
18. 18. Scanner class is defined in_______
a) java.util package
b) java.lang package
c) java.io package
d) none
19. 19. Scanner class is used to take input at_____.
a) compile-time
b) rum-time
c) both a& b
d) none
20. 20. Which stream is used for input.
a) System.out
b) System.in
c) Scanner
d) System
21. 21. Which stream is used for output
a) System.out
b) System.in
c) Scanner
d) System
22. 22. Which Scanner class method is used to read integer value?
a) nextInt()
b) next()
c) readInt()
d) nextInteger()
23. 23. Which Scanner class method is used to read String value?
a) nextInt()
b) next()
c) nextLine()
d) both b & c
24. 24. How many types of data types in java?
a) One
b) Two
c) Three
d) Four
25. 25. How many primitive data type in java?
a) 5
b) 8
c) 7
d) 6
26. 26. What is the size of char datatype?
a) 4bytes
b) 8bytes
c) 2byte
d) 1byte
27. 27. What is the default value of Boolean data type?
a) True
b) False
c) Both
d) none
28. 28. Which of the following is the smallest integer datatype?
a) Int
b) Char
c) Byte
d) Boolean
29. 29. What is the range of byte data types
a) 127 to 128
b) -127 to 128
c) -128 to 127
d) 128 to 127
30. 30. Which of the following is not a part of Binary Operator
a) Assignment
b) Arithmetic
c) Relational
d) Logical
31. 31. Which of the following is not an arithmetic operator?
a) +
b) %
c) *
d) &
32. 32. How many types of logical operators?
a) 2
b) 4
c) 3
d) 5
33. 33. Relational operator is used for?
a) Comprassion
b) Finding error
c) assignment
d) all the above
34. 34. Which operator is used for alternate of if-else statement?
a) Arithmetic
b) Ternary
c) Bitwise
d) Inc/dec
35. 35. What is the default value of static variable?
a) 0
b) 1
c) garbage
d) none
36. 36. Which of the following is Bitwise AND operator?
a) &&
b) ||
c) !
d) &
37. 37. A variable which is declared inside the method called_____.
a) Instance
b) Static
c) Local
d) none
38. 38. Which of these selection statement test only for equality
a) if
b) if & switch
c) switch
d) none
39. 39. If statement execute or skip statement depending on the________expression.
a) Boolean
b) Integeric
c) Double
d) none
40. 40. Which loop is an entry-controlled loop?
a) for
b) while
c) do-while
d) both a & b