Download Java Test Paper 1 30 X 0.5 = 15 Marks What does JDK stands for

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Java Test Paper 1
30 X 0.5 = 15 Marks
1. What does JDK stands for ______________________
2. Which of the following is not the java keyword?
a) int
b) goto
c) strictfp
d) none
3. JRE is platform independent?True or False
4. What are control Statements?
a) Statement which changes the execution flow
b) Statement which controls the code
c) Statement controlled by JVM
d) All of the above
5. Which of the following is not true about switch statement?
a) writing the cases in ascending order is not must in switch statement
b) switch can be without default case
c) break keyword is must in all the cases
d) none of the above
6. What is a class in java ?
7. What are Marker Interface ?
8. All Java classes are sub classes of Object class ?True or False
9. Which of the following is not the method of Thread class ?
a) sleep()
b) wait
c) run()
d) none of these
10. Which Collection class is used to eliminate duplicate Objects ?
a) ArrayList
b) LinkedList c) Vector
d) HashSet
11. Which of the following gives compilation error ?
a) int I = ‘a’;
b) float f = 3.14;
c) char ch = (char)65;
d) none of these
12. What is the output of the following code
class Test{
public static void main(String[] args){
}
void printMessage(){ System.out.println(“Message”);}
}
a) Compilation Error
b) Runtime Error
c) Message
d) no output
13. What is the output of the following
class Test{
public static void main(String[] args){
for(;;);
Visit us : [email protected] n
www.chromatech.in
}
14.
15.
16.
17.
18.
19.
20.
21.
22.
}
a) Infinite Loop
b) finite Loop
c) Compilation Error
d) Runtime Error
What is the output of the following
Class A extends java.lang.Object{
}
class Test extends A{
}
a) Compilation Error
b) Runtime Error
c) No Error
d) Exception
What is the output of the following
class Test{
public static void main(String[] args){
List<String> list = new ArrayList<String>();
list.add(“Java”); list.add(“C++”); list.add(“php”);
}
}
a) Exception
b) No Error
c) Java C++ php
d) Compilation Error
Which of the following server is widely used for JSP ?
a) Apache Tomcat
b) JBoss
c) JBoss
d) none of these
All request comes from client is considered as new request in servlet technologies?
a) True
b) False
Which of these method is used to dispatch the request ?
a) request.getRequestDispatcher(“”).forward();
b )response.getRequsetDispatcher(“”).forward();
c) request.dipatchRequest().include();
d) response.dispatchRequest().include():
Which of these statement is true about session Management
a) It is used to track the user details
b) It is a common storage area which all servlet can make use of it
c) Only A
d) Both A & B
All JSP can be considered as servlet ?
a) True
b) False
Which of the following is the correct driver for connection with MySql
a) com.jdbc.mysql.driver
b)com.mysql.jdbc.Driver
c)com.java.mysql.Driver
d)com.connect.mysql.Driver
Connection is not a Class ?True or False?
Visit us : [email protected] n
www.chromatech.in
23. CallableStatement is used for
a) Both B & C
b) Calling the function of java
c) Calling the stored procedure
d) none of the above
24. getConnection is what type of method ?
a) private
b) protected
c) static
d) final
25. ResultSet Interface is used for
a) used to process the fetched records
b) used to extract data
c) used to insert set of processed result to Database
d) All of the above
26. What does MVC stands for ?
a) Model View Connector
b) Model View Controller
c) Module View Controller
d) Module View Connector
27. Spring framework is popular for ?
a) SpringMVC
b) JdbcTemplate
c) HibernateTemplate
d) All of the above
28. Dependency injection is a
a) Design Pattern
b) Technology
c) Class
d) Interface
29. ApplicationContext has more than one implementation classes ?
a) True
b) False
30. Struts framework is most popular for
a) Reusability
b) Maintanence
c) MVC
d) none of these
15 X 2 = 30 Marks
31. Write a Java Program to sort an Array in ascending order
32. Write a Java Program to create Employee class which contains name,id,age,mobile and salary
properties and getter, setter methods for each and every properties.
Visit us : [email protected] n
www.chromatech.in