advanced java programming mcq

Hello friends welcome to the Programming Friend. here you can find your study related articles for exams, competitive exams, interview  and programming languages related queries questions etc.

So without get any more time let's get started.

Advanced java programming MCQ's are in the chapterwise with the answers:


Chapter 1

Abstract Windowing Toolkit:

Q.1 AWT stands for...............

Ans: Abstract Windowing Toolkit.


Q.2 AWT is used for GUI Programming In Java.

Ans: True,AWT is used for GUI Programming in Java.


Q.3 Which class has provide many methods for graphics programming?

Ans: java.awt.Graphics.


Q.4 Which container has contain title bar , menubars and other components like button,text fields etc.?

Ans: Frame.


Q.5 Which container that does not contain the title bar ,menubars and other components like button ,text field etc.?

Ans: Panel.


Q.6 Which is the AWT component that contain another components like buttons,text fields,labels etc.?

And: Container.


Q.7 Which method in which you can set/change the text in a label ?

Ans: setText() method.


Q.8 Which class is used to create a pop-up list of items from which the user choose?

Ans: Choice.


Q.9 What is used to store data and partial results ,perform dynamic linking ,return values for the methods and dispatch exceptions ?

Ans: frame.


Q.10 These  4 methods are commonly used in ?

1.public void setVisible( Boolean)

2.piblic void setLayout(LayoutManager m)

3.public void setSize( int width,int height)

4.public void add( Component c)

Ans: Component class.


Q.11 Public class menubars extends................. 

Ans: MenuComponent.


Q.12 Panel is defined as .....................

Ans: Window that doesn't contain title bar ,menubar and border.


Q.13 What Is API ?

Ans: Application Programming Interface.


Q.14 What is Default layout for Dialog ?

Ans: FlowLayout.


Q.15 Which method is used to count the number of items in the list?

Ans: getItemCount().


Q.16 Correct hierarchy for panel is ............

Ans: Component - container - Panel.


Q.17 Which is the correct constructor of GridLayout?

Ans:  GridLayout(int num_rows,int num_ columns.


Q.18What ae the types of Dialog box?   

Ans: modal and modeless Dialogbox.


Q.19 Which class is used to represent single line textbox with password character facility?              Ans: TextField.


Q.20  Which of the method is used to output a String in an Applet?

Ans: drawString()


Q.21 when there is switching condition like ON or OFF ,which condition is used ?

Ans: Toggle button.


Q.22 which method is used to set a TextComponent to read only mode?

Ans:setEditable(). 


Q.23 which AWT component is not editable?

Ans: TextField.


Q.24 which package is used go Graphical User Interface?

Ans: java.awt.


Q.25 Current text of Label can be obtained by using ..........

Ans: getText().


Q.26 The Default layout of applet is 

Ans: FlowLayout.


Q.27 java applet are used to create ............. Application.

Ans: Graphical and user interactive.


Chapter.2 

Swing:

Q.1 Swing is not a part of JFC ( java foundation classes) that is used to create a GUI application?

Ans: False.


Q.2 The Swing component classes that are used in encpasulates a mutually exclusive set of button?

Ans: Button Group.

Q.3 The Java Foundation Classes(JFC) is a set of GUI Component which simplify the development of desktop applications?
ANS: True.

Q.4 which package is used go through import the swing components?
Ans: javax.swing.

Q.5 MVC architecture is ...................
Ans: Model - View - Controller.

Q.6 which package is used for importing swing components?
Ans: javax.swing.

Q.7 In Swing buttons are subclasses of which class?
Ans: AbstractButton.

Q.8 Matter class belongs to which package?
Ans: javax.swing.

Q.9 which component in swing represents data and columns ?
Ans: JTable.

Q.10 which is not constructor of JTree?
Ans: JTree(int x).

Q.11 which class is used to create node in tree?
Ans: DefaultMutableTreeNode.

Q.12 JtabbedPane class is present in which package ?
Ans: javax.swing.

Q.13 what is the purpose of JTree?
Ans: show data in form of parent and child nodes.

Q.14 what is the used of Container getContentPane()?
Ans: Returns a ContentPane for Applet.

Q.15 which of the method is not applicable for button in swing?
Ans: setSelectedIcon.

Q.16 which method is used to retrieve icon of JButton?
Ans: ImageIcon getIcon()

Q.17 Which component provides support for two state buttons?
Ans: JCheckBox,JRadioButton.


Chapter 3.

Event handling :


Q.1 Which places put the event handling code?
Ans: same class ,Anonymous class or other class.

Q.2 Which package provides many events classes band listener interfaces for the event handling?
Ans:java.awt.event.

Q.3 The ActionListener interface is not used for  handling action  events? True or false.
Ans: false

Q.4 The ActionListener Interface is used for handling action events,for ex: it's used by a 
Ans: JButton, JCheckBox,JmenuItem.

Q.5whichbclass is used for processing method process Action event ()?
Ans: Button,List,MenuItem.

Q.6 which method is used determine the type of adjustment event?
Ans: getAdjustmentType()

Q.7  Text Field generates..... event.
Ans: ActionEvent,TextEvent.

Q.8 void KeyTyped called when a key on the keyboard is............
Ans: pressed and then released.

Q.9which event is generated when the position of scrollbar is changed?
Ans: AdjustmentEvent. 

Q.10 The signature for registration method for ActionEvent should be............
Ans: public void add ActionListener(ActionListener).

Q.11 which component generates ActiinEvent?
Ans : Window, Radiobutton,scrollbar.

Q.12 ............method is used to register a keyboard event listener.
Ans: addKeyListener().

Q.13 The MouseListener interface is used to make mouse handling.
Ans: True.

Q.14 ActionEvent is applied on ..........
Ans: Button, TextField, list, menu.

Q.15 ComponentEvent is the superclass of ..................
Ans: FocusEvent,ComponentEvent, AdjustmentEvent.

Q.16 Which Listener handles all list related events?
Ans: ItemListener.

Q.17 The ............. Is an object that is notified when an event occurs.
Ans: Listener.

Chapter.4

Networking Basics:

Q.1 UDP stand for......
Ans: User Datagtam Protocol.

Q.2 The class which is used to create a port where the server will listen
Ans: Socket.

Q.3 Communication using TCP protocol is ........... And..............
Ans: connection oriented ,concurrent.

Q.4 java.net package consist of interface ...............
Ans: ContentHandlerFactory, SocketImplFactory.

Q.5 IPv6 uses ............
Ans: 8 groups of 4 hexa decimal digits each.

Q.6 what is the full form.of DNS?
Ans: Domain Naming Service.

Q.7 which is the bundle of India passed between machines?
Ans: Datagram.

Q.8 Port number for FTP is ............
Ans: 21

Q.9 The class which encapsulates both the numerical IP address and the domain name for that address is..............
Ans: InetAddress.

Q.10 The constructor of URL can throw an exception called.......
Ans: MalFormedUrlException.

Q.11 which up address ismulticast up address? 
Ans: 192.168.2.32 or 235.55.45.2

Q.11 which 5 parameter identify a connection?
Ans: Local IP, Local Port,Remote MAC, Remote PORT and Protocol.

Q.12which method is used to create a URL connection?
Ans: URL Connection

Chapter 5

Interacting with Database:

Q.1 Which package contains classes that help in connecting to the database ,sending SQL statement to the database and process the query request?
Ans: java.sql.

Q.2 which is not a type of jdbc driver?
Ans: JDBC - native pure java driver.
 
Q.3 In JDBC Whqt is imports all java classes that are concern with database connectivity?
Ans: java.sql.

Q.4 what is the purpose of next() method?
Ans: to retain the next record in a series.

Q.5  Native protocol pure java driver converts ............... In to the ...............directly.
Ans: JDBC calls,User calls 

Q.6 SQL stands for ...
Ans: Structured Query Language.

Q.7 Public class DriverManager extends ............
Ans: Object.

Q.8 Which is the main component of JDBC API?
Ans: Drive manager.

Q.9 ODBC minimum SQL grammer contains...........
Ans:insert,update, delete only.

Q.10 Microsoft Access Data in .........
File format.
Ans: .MDB




















Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.