MsbtevancedavaCQizAJP17 December 9, 2024September 21, 2023 by ownerAdvanced Java Programming VI-MCQ Exam (22517)Page 1 of 601. 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 Page 2 of 602. 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 Page 3 of 603. Java are used to create ________ Applets applications. (A) Graphical (B) user interactive (C) Both A and B (D) None of these. Page 4 of 604.What is API? (A) Application Programming Interchange (B) Application Programming Interface (C) Application Programming Interaction (D) None of these Page 5 of 605. 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 Page 6 of 606. Give the abbreviation of AWT? (A) Applet Windowing Toolkit (B) Abstract Windowing Toolkit (C) Absolute Windowing Toolkit (D) None of the above Page 7 of 607. The default layout manager of Frame is________. (A) FlowLayout (B) BorderLayout (C) CardLayout (D) GridLayout Page 8 of 608. Which of the following does not have its default layout as BorderLayout.? (A) Frame (B) Dialog (C) JApplet (D) of All Above Page 9 of 609. The layout of default Applet is _______. (A) GridLayout (B) CardLayout (C) FlowLayout (D) BorderLayout Page 10 of 6010. Which class defines setSize( ) method? (A) Component (B) Frame (C) Applet (D) Pane Page 11 of 6011. Which method of the Applet class displays the result of applet code on screen? (A) run() method (B) paint() method (C) drawString() method (D) main() method Page 12 of 6012. Which AWT component is not editable? (A) Button (B) FlowLayout (C) TextField (D) Label Page 13 of 6013. Which package is used for import the swing components? (A) java.swing (B) java.awt (C) javax.swing (D) all of the above Page 14 of 6014. By which method we can set or change the text in a Label in AWT? (A) setText() (B) getText() (C) addText() (D) all of these Page 15 of 6015. What is purpose of JTree? (A) To show data in list view. (B) To show data in tabular form. (C) To show data in menu bar (D) To show data in form of parent and child nodes Page 16 of 6016. Which component is used to compile, debug and execute the java programs? (A) JRE (B) JDK (C) JVM (D) JIT Page 17 of 6017. Which one of the following is not a Java feature? (A) Portable (B) Object-oriented (C) Use of pointers (D) Dynamic and Extensible Page 18 of 6018.Which of the following is not a feature of Java? (A) Pointers (B) Dynamic typing (C) Automatic memory management (D) Platform independence Page 19 of 6019. What is the extension of java code files? (A) .js (B) .txt (C) .class (D) .java Page 20 of 6020. Which is passive control that do not support any interaction with the user? (A) Choice (B) List (C) Labels (D) Checkbox Page 21 of 6021.Java applet are used to create_________applications. (A) graphical (B) user interactive (C) Both (a) and (b) (D) none of the above Page 22 of 6022. What is the difference between an applet and an application? (A) An applet is a small program that is embedded in a web page, while an application is a standalone program that can be run on the user’s computer. (B) An applet is written in Java, while an application can be written in any language. (C) An applet can only be run in a web browser, while an application can be run in any environment that has a Java Virtual Machine (JVM). (D) All of the above. Page 23 of 6023. What is the purpose of the Java Swing library? (A) To provide a set of graphical user interface (GUI) components that can be used to create Java applications. (B) To provide a set of classes that can be used to create web applications. (C) To provide a set of classes that can be used to create database applications. (D) To provide a set of classes that can be used to create games. Page 24 of 6024. What is the purpose of the Java JDBC API? (A) To provide a set of classes that can be used to connect to a database. (B) To provide a set of classes that can be used to create web applications. (C) To provide a set of classes that can be used to create games. (D) To provide a set of classes that can be used to create database applications. Page 25 of 6025. What is the output of the following code? public class Test { public static void main(String[] args) { int a = 10; int b = 20; System.out.println(a – b); } } (A) 10 (B) 20 (C) -10 (D) None of the Above Page 26 of 6026. Which keyword is used in Java to explicitly specify that a method does not return any value? (A) int (B) void (C) null (D) None of the above Page 27 of 6027. In Java, what will be the result of the following code snippet?int x = 5; System.out.println(x++ + ++x); (A) 11 (B) 12 (C) 13 (D) 14 Page 28 of 6028. Which of the following statements is true about Java servlets? (A) Each servlet has a unique instance for each client request. (B) Servlets cannot respond to HTTP requests. (C) Servlets are only used to generate static web pages. (D) Servlets are used for client-side scripting in web applications. Page 29 of 6029. Which of the following statements is true about Java abstract classes and interfaces? (A) Interfaces can have constructor definitions, while abstract classes cannot. (B) Abstract classes can be directly instantiated using the “new” keyword, while interfaces cannot. (C) Interfaces can have access modifiers like public, protected, and private, while abstract classes cannot. (D) Abstract classes can have both abstract and concrete methods, while interfaces can only have abstract methods. Page 30 of 6030. Which of the following is not a core interface of the Java Collections Framework? (A) List (B) Array (C) Set (D) Map Page 31 of 6031. The setSize( ) method is defined by this class… (A) Applet (B) Component (C) Frame (D) Panel Page 32 of 6032. Which Java collection interface extends the Collection interface and ensures that each element is unique and has no specific order? (A) Set (B) List (C) Map (D) Queue Page 33 of 6033. Which of these methods is a part of Abstract Window Toolkit (AWT)? (A) drawString() (B) transient() (C) display() (D) paint() Page 34 of 6034. Default layout manager for subclasses of window is _____ (A) Card layout (B) GridBaglayout (C) BorderLayout (D) Frame Page 35 of 6035. Which of these methods can be used to output a string in an applet? (A) display() (B) print() (C) drawString() (D) transient() Page 36 of 6036. The setBackground() method is part of the following class in java.awt package: (A) Component (B) Graphics (C) Applet (D) Container Page 37 of 6037. Which of the following is the advantage of using the JDBC connection pool? (A) Slow performance (B) Better performance (C) Using more memory (D) Using less memory Page 38 of 6038. Which method will cause a Frame to be displayed? (A) display() (B) displayFrame() (C) paint() (D) setVisible() Page 39 of 6039. How do you change the current layout manager for a container? (A) Use the setLayout method (B) Use the setLayoutManager method (C) Use the updateLayout method (D) Once created you cannot change the current layout manager of a component Page 40 of 6040. __________layout arranges the components horizontally: (A) BorderLayout (B) CardLayout (C) FlowLayout (D) GridLayout Page 41 of 6041. Which method returns the preferred size of a component? (A) getLayout() (B) getPreferred() (C) getRequiredSize() (D) getPreferredSize() Page 42 of 6042. Using a FlowLayout manager, which is the correct way to add elements to a container? (A) set(component); (B) add (component); (C) add(“Center”, component); (D) add(x, y, component); Page 43 of 6043. Which object can be constructed to show any number of choices in the visible window? (A) Labels (B) Choice (C) List (D) Checkbox Page 44 of 6044. Which method can set or change the text in a Label? (A) setText() (B) getText() (C) All the above (D) None of the above Page 45 of 6045. 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 Statement Page 46 of 6046. Which layout manager places components in one of five regions: north, south, east, west, and center? (A) CardLayout (B) FlowLayout (C) BorderLayout (D) GridLayout Page 47 of 6047. All the AWT controls are subclasses of which class? (A) Window (B) Container (C) AWTControl (D) Component Page 48 of 6048. JPanel and Applet use as their default layout (A) FlowLayout (B) FixedLayout (C) RelativeLayout (D) ConstrainLayout Page 49 of 6049. A is Component that represents a hierarchical view of data (A) List (B) Jtree (C) Awt Component (D) java Components Page 50 of 6050. Which is not a Swing Component (A) Box (B) Checkbox (C) CheckboxGroup (D) java awt Page 51 of 6051. To draw a line in applet, we use following method (A) Line() (B) drawLine() (C) paintLine() (D) ShowLine() Page 52 of 6052. Which of the following statements regarding Java interfaces is correct? (A) A class that implements an interface must provide definitions for all methods in the interface. (B) Interfaces can have instance variables defined with access modifiers. (C) Interfaces can extend multiple classes to inherit their behavior. (D) A class can implement multiple interfaces to achieve multiple inheritance in Java. Page 53 of 6053. Which Java collection interface extends the Collection interface and ensures that each element is unique and has no specific order? (A) Set (B) List (C) Map (D) Queue Page 54 of 6054. What is the output of the following Java code snippet?int[] numbers = {1, 2, 3, 4, 5}; for (int i = 0; i < numbers.length; i++) { System.out.print(numbers[i] + " "); } (A) 1 2 3 4 5 (B) 5 4 3 2 1 (C) 1 3 5 (D) 1 Page 55 of 6055. In Java, which class is used to create a thread by implementing the Runnable interface? (A) Executor (B) Timer (C) Thread (D) ThreadGroup Page 56 of 6056. Which of the following Java technologies is used to create web applications that follow the Model-View-Controller (MVC) architectural pattern? (A) Servlets (B) RMI (Remote Method Invocation) (C) JDBC (Java Database Connectivity) (D) JSP (JavaServer Pages) Page 57 of 6057. What will be the result of the following Java code snippet?int x = 10; int y = 20; int z = x > y ? x++ : y++; System.out.println(z); (A) 10 (B) 20 (C) 21 (D) 22 Page 58 of 6058. In Java, what does the term “boxing” refer to? (A) Converting a primitive data type into its corresponding wrapper class object (B) Unboxing a wrapper class object to retrieve the primitive data type (C) Converting an object into a byte stream for serialization. (D) Creating an instance of a user-defined class using the “new” keyword. Page 59 of 6059. What is the output of the following Java code snippet?int[][] matrix = {{1, 2}, {3, 4}}; for (int i = 0; i < matrix.length; i++) { for (int j = 0; j < matrix[i].length; j++) { System.out.print(matrix[i][j] + " "); } } (A) 1 3 2 4 (B) 2 4 1 3 (C) 1 2 3 4 (D) 4 3 2 1 Page 60 of 6060. Which Java feature is used to achieve multiple method definitions with the same name but different parameter types in a class? (A) Overriding (B) Polymorphism (C) Encapsulation (D) Overloading Full Name *Select Branch *Please select an optionComputer EngineeringInformation TechnologyOthersSelect your District *Please select an optionAhilyadevi NagarAkolaAmravatiBeedBhandaraBuldhanaChhatrapati Sambhaji NagarChandrapurDhuleDharashivGadchiroliGondiaHingoliJalgaonJalnaKolhapurLaturMumbai CityMumbai SuburbanNagpurNandedNandurbarNashikPalgharParbhaniPuneRaigadRatnagiriSangliSataraSindhudurgSolapurThaneWardhaWashimYavatmalIn which college do you study ?Email Address *Mobile Number *0 / 10Start ExamPlease do not fill in this field.