Hello Diploma Students in this article we have provided Advanced Java Programming Mcq Questions with Answers Pdf. With the help of this Advanced Java Programming Online Mock Test Diploma in Information & Technology and Computer Engineering Students can Practice for their Upcoming Winter 2021 Exams.
In this Advanced Java Programming mcq pdf We have selected Important Questions from Previous Year Model Answer Paper and Made A possible Set Of 30 Questions which can Help Students in Preparation for Their Exams. This Mcq on Advanced Java Programming Is Ideal for Candidates who are in 3rd Year of Diploma in Information Technology and Computer Engineering Course.
By Referring this Advanced Java Programming Mcq Msbte Diploma in Information Technology & Computer Engineering Students Can Practice for their Upcoming Exams. We Have Also Provided Advanced Java Programming mcq pdf Link at the end of the Quiz You can Download it for Future Refrence.
Mcq on Advanced Java Programming
1) Which class can be used to represent a checkbox with a textual label that can appear in a menu. Select the one correct answer.
a. MenuBar
b. MenuItem
c. CheckboxMenuItem
d. Menu
Correct!
Wrong!
2) Which is/are used to create a Frame? i. By creating the object of Frame Class(association) ii. By extending Frame class(inheritance)
a. Only i
b. Only ii
c. Both
d. None
Correct!
Wrong!
3) Which of the following sets the frame, say frame to 300 pixels wide by 200 high?
a. fram.setSize( 300, 200 );
b. fram.setSize( 300, 200 );
c. fram.paint( 300, 200 );
d. fram.setVisible( 300, 200 );
Correct!
Wrong!
4) Which of the following is/ are not related with keyboard event?
a. ClassKeyEvent is used to notify if any key pressed occurs or not.
b. The KeyListener should be added either in init() or the main method.
c. RequestFocus should be added either in init() or the main method.
d. The class InputEvent should be imported explicitly in the program
Correct!
Wrong!
5) Which of the following packages supports the event handling routine, when we use Swing components in GUI programs?
a. javax.swing
b. java.awt
c. java.util
d. Java.applet
Correct!
Wrong!
6) Which of the following displays components row-by-row in the order in which they were added to the JFrame?
a. CardLayout
b. FlowLayout
c. BorderLayout
d. GridLayout
Correct!
Wrong!
7) Using a FlowLayout manager, which is the correct way to add elements to a container?
a. add (component);
b. add(“Center”, component);
c. add(x, y, component);
d. set(component);
Correct!
Wrong!
8) Which layout manager places components in one of five regions: north, south, east, west, and center?
a. CardLayout
b. FlowLayout
c. BorderLayout
d. GridLayout
Correct!
Wrong!
9) The MouseListener interface specifies the following methods: mouseClicked, mouseEntered, mouse-Exited, mousePressed, and mouseReleased. In order to use a MouseListener in your code, you must provide an implementation for which of the following?
a. None of the MouseListener methods.
b. All MouseListener methods.
c. At least the mouseClicked method
d. Any one MouseListener method
Correct!
Wrong!
10) Where are the following four methods commonly used? 1) public void add(Component c) 2) public void setSize(int width,int height) 3) public void setLayout(LayoutManager m) 4) public void setVisible(boolean)
a. Graphics class
b. Component class
c. Both A & B
d. None of the above
Correct!
Wrong!
11) Which is the container that doesn’t contain title bar and MenuBars but it can have other components like button, textfield etc?
a. Window
b. Frame
c. Panel
d. Container
Correct!
Wrong!
12) Which method is used to set the graphics current color to the specified color in the graphics class?
a. public abstract void setFont(Font font)
b. public abstract void setColor(Color c)
c. public abstract void drawString(String str, int x, int y)
d. None of the above
Correct!
Wrong!
13) In Graphics class, which method is used to draw a rectangle with the specified width and height?
a. public void drawRect(int x, int y, int width, int height)
b. public abstract void fillRect(int x, int y, int width, int height)
c. public abstract void drawLine(int x1, int y1, int x2, int y2)
d. public abstract void drawOval(int x, int y, int width, int height)
Correct!
Wrong!
14) Which object can be constructed to show any number of choices in the visible window?
a. Labels
b. Choice
c. List
d. Checkbox
Correct!
Wrong!
15) Which class is used for this Processing Method processActionEvent( )?
a. Button,List,MenuItem
b. Button,Checkbox,Choice
c. Scrollbar,Component,Button
d. None of the above
Correct!
Wrong!
16) Which method can set or change the text in a Label?
a. setText()
b. getText()
c. All the above
d. None of the above
Correct!
Wrong!
17) The following
a) It is lightweight.
b) It supports pluggable look and feel.
c) It follows MVC (Model View Controller) architecture are the advantages of _____ .
a. Swing
b. AWT
c. Both A & B
Correct!
Wrong!
18) The ActionListener interface is not used for handling action events.
a. True
b. False
Correct!
Wrong!
19) Which package provides many event classes and Listener interfaces for event handling?
a. java.awt
b. java.awt.Graphics
c. java.awt.event
d. None of the above
Correct!
Wrong!
20) Which of the following types of JDBC driver should be used if your Java application is accessing multiple types of databases at the same time?
a. Type 1
b. Type 2
c. Type 3
d. Type 4
Correct!
Wrong!
21) Which of the following is correct about JDBC?
a. JDBC architecture decouples an abstraction from its implementation.
b. JDBC follows a bridge design pattern.
c. Both of the above.
d. None of the above.
Correct!
Wrong!
22) Which of the following steps establishes a connection with a database?
a. Import packages containing the JDBC classes needed for database programming.
b. Register the JDBC driver, so that you can open a communications channel with the database.
c. Open a connection using the DriverManager.getConnection () method.
d. Execute a query using an object of type Statement23) Which of the following is true about JDBC?
Correct!
Wrong!
23) Which of the following is true about JDBC?
a. The JDBC API is an API to access different relational databases.
b. You use it to access relational databases without embedding a dependency on a specific database type in your code.
c. JDBC stands for Java DataBase Connectivity.
d. All of the above.
Correct!
Wrong!
24) Which of the following is the advantage of using the JDBC connection pool?
a. Slow performance
b. Using more memory
c. Using less memory
d. Better performance
Correct!
Wrong!
25) How many Result sets are available with the JDBC 2.0 core API?
a. 2
b. 3
c. 4
d. 5
Correct!
Wrong!
26) Which method is used to establish the connection with the specified url in a Driver Manager class?
a. public static void registerDriver(Driver driver)
b. public static void deregisterDriver(Driver driver)
c. public static Connection getConnection(String url)
d. public static Connection getConnection(String url,String userName,String password)
Correct!
Wrong!
27) Which driver Network connection is indirect that a JDBC client makes to a middleware process that acts as a bridge to the DBMS server?
a. JDBC-Net
b. JDBC-ODBC bridge
c. Native API as basis
d. Native protocol as basis
Correct!
Wrong!
28) JDBC RowSet is the wrapper of ResultSet,It holds tabular data like ResultSet but it is easy and flexible to use.
a. True
b. False
Correct!
Wrong!
29) The ResultSet.next method is used to move to the next row of the ResultSet, making it the current row.
a. True
b. False
Correct!
Wrong!
30) Which JDBC product components does the Java software provide?
We provide regular updates about msbte on our social accounts For latest msbte diploma updates you can follow our page on Instagram @msbtenews and Facebook @msbtediplomaupdates. we solve your queries by message on our social accounts so do follow our social accounts if you have any queries related to diploma and engineering courses.
Msbte News is created to help msbte diploma students to find study resources, which are very much needed for diploma students while preparing for the exam. msbtenews.com provide polytechnic solved question papers which are provided by msbte.org.in. with these msbte polytechnic model answer paper students gets a rough idea about paper pattern and marks distribution.