CS506 Solved Grand Quiz Spring 2021
Welcome to CS506 Grand Quizzes at VUExamGuide.com – your ultimate destination for 100% Correct Answers! If you are a CS506 student at VU, looking for a reliable study resource to excel in your quizzes and exams, you’ve come to the right place.
Our CS506 Grand Quizzes cover a wide range of topics, meticulously prepared by our expert team to ensure accuracy and depth of understanding. With a focus on Web Design and Development, these quizzes will enhance your knowledge and problem-solving skills in creating dynamic and interactive websites.
No more struggling with complex coding challenges or uncertain solutions! VUExamGuide.com empowers you to excel in CS506. Embrace the knowledge and skills you need to become a proficient web developer and create cutting-edge web applications.
Join us now and embark on a journey of academic excellence with CS506 Grand Quizzes. Prepare to shine and propel yourself towards a brighter future – start exploring VUExamGuide.com today!
Welcome to CS506 Grand Quizzes at VUExamGuide.com – your ultimate destination for 100% Correct Answers! If you are a CS506 student at VU, looking for a reliable study resource to excel in your quizzes and exams, you’ve come to the right place.
Our CS506 Grand Quizzes cover a wide range of topics, meticulously prepared by our expert team to ensure accuracy and depth of understanding. With a focus on Web Design and Development, these quizzes will enhance your knowledge and problem-solving skills in creating dynamic and interactive websites.
No more struggling with complex coding challenges or uncertain solutions! VUExamGuide.com empowers you to excel in CS506. Embrace the knowledge and skills you need to become a proficient web developer and create cutting-edge web applications.
Join us now and embark on a journey of academic excellence with CS506 Grand Quizzes. Prepare to shine and propel yourself towards a brighter future – start exploring VUExamGuide.com today!
CS506 SOLVED MCQs
Sr.NO | MCQS QUESTIONS: | ANSWER: |
1 | FTP (File Transmission Protocol) works on _____________ port. | 21 |
2 | Which of the following is NOT true for java inner classes? | Generally used as public utility classes |
3 | Which statement from the following statements is true about java Anonymous Inner class | (A) It is difficult to understand (B) It has no name (C) it is much shorter Answer:(D) All of the given options |
4 | While running following ExceptionExample.java class on command line without passing command line arguments gives ________ exception. public class Exception Example { public static void main (String args[]){ System.out.println(args[0]); }} | Array index out of bound exception |
5 | Exception handling code is written in ______. | catch block |
6 | Let suppose a column has index 5 in the ResultSet object. Which of the following statement is used to retrieve the column values? | String name=rs.getString(5) |
7 | Which of the following streams is a byte oriented stream? | FileInputStream |
8 | Which of the following statements is true about primitive data types and reference data types? | Primitive data types are created on stack whereas references are created on heap |
9 | Which command of the following commands is used to compile “Java Test” java file’s code? | javac JavaTest.java |
10 | Which of the following statements is true regarding paintComponent() method? | It first paints the background and then performs custom painting. |
11 | WindowListener interface contains ________ methods. | Seven |
12 | HashMap takes key as a/an ________ | Object |
13 | Adapter classes have been defined for listener interfaces except _________ interface. | ActionListener |
14 | Interface imposes _____________ structure on any class that uses interface | design |
15 | Which of the following is NOT true about paintComponent() method? | Tells the components border (if any) to paint. |
16 | An object of Student.java class is creating and setting its value in Test.java class __________ error is there in given code. public class Test{ public static void main (String args[]){ Student s2 = new Student(); s2->setName(“Aslam”); } } | setName method should not be accessed by arrow operator |
17 | The “MouseDragged” and “mouseMoved” method are defined in _________ interface. | MouseMotionListner |
18 | previous() is a method of __________ object. | ResultSet |
19 | Which of the following driver type(s) has better performance than other? | Type 4: Native – protocol /all – java driver |
20 | For a programmer the event handling is a three step process in term of code. Which of the following is NOT an event handling step? | Publish event |
21 | Which feature of the following features does Java provide? | Function Overriding |
22 | What will happen if static modifier is removed from the signature of main method? | The program will compile but not run. |
23 | Bytecodes are put in memory by ____________. | class loader |
24 | Which of the following is the correct syntax to make a PersonInfo class into a Serializable class | Public class PersonInfo implements Serializable {/*class body*/} |
25 | The following code creates and starts a timer that fires an action event once per ________ Timer t = new Timer (1000,this); t.start(); | Second |
26 | CmdArgs java class is compiled. If the command “java CmdArgs CS506” run in cmd, then what will be output of given code. Public class CmdArgs{ public static void main (String[]args){ System.out.println(“First argument” + args[0]); } } | CS506 |
27 | Which of the following functions is declared in MouseMotionListener interface? | public void mouseDragged(MouseEvent me); |
28 | Which of the following classes provide definitions for all the methods (empty bodies) of their corresponding Listener interface? | adapter classes |
29 | What will happen if main method is declared as private? | The program will throw an exception at run time |
30 | To make sure array accesses touch only the memory allocated to them. JVM does _________checking at runtime. | dynamic |
31 | What will happen if static modifier is removed from the signature of main method? | The program will compile but not run |
32 | Which of the following is NOT true for java inner classes? | Generally used as public utility classes |
33 | A hash map object is to create, to store Teacher objects as values and their CNIC in the form of strings as keys. Which syntax is correct for this requirement? | HashMap <String,Teacher> h =new HashMap<String, Teacher>(); |
34 | A scrollable and updatable ResultSet object has the following capabilities except______ | insert new columns |
35 | Which of the following classes is capable to instantiate? | Concrete class |
36 | Which of the following objects is passed as an argument to paintComponent()method? | Graphics object |
37 | It is verified by __________ that not all bytecodes violate java security restrictions. | bytecode verifier |
38 | An event in java is represented as ___________. | Object |
39 | In given lines of code ____________________ is applying. double a = 9.5; int b = (int) a; | downcasting a to b type |
40 | Which of the given will clear all the previous painting? | super.paintCompnent() |
41 | The following is an example of _________. FileReader fr = new FileReader(“input.txt”); | Node stream |
42 | Strings in java are represented as _________. | Reference data types |
43 | AWT is also called ______. | Heavy weight components |
44 | Choose the correct syntax to define an interface named as “Speaker” in java language. | public interface Speaker{} |
45 | In Java, if a super class method is protected then overriding method ___________. | may be either protected or public |
46 | Timer class constructor requires time in____ . | milli seconds |
47 | The ___________ is directly connected with keyboard. | Node stream |
48 | For each class contained in java source file, compiler generates _________ class file/s. | one |
49 | In given lines of code ____________________ is applying. int a = 20; double b = a; | upcasting a to b type |
50 | Which of the following methods is called only once during the life cycle of an Applet? | destroy() |
51 | If there is a class “Student”, then the java files must be saved with ________ name. | Student.java |
52 | Which of the following statement object is used to execute simple SQL statement? | Statement |
53 | Which feature of the following featured is not included in Java language? | Pointer manipulation |
54 | Which of the following methods is used to convert a string into an int value? | ParseInt() |
55 | Which of the following is a valid variable name in Java? | NumberOfStudent |
56 | Which of the following features is available in java? | Primitive data types |
57 | A port is a __________________ to which processes can listen for connections request. | Transport Address |
58 | Which of the following is called “pure abstract class”? | Interface |
59 | Which of the following packages needs to import while handling files? | java.io |
60 | How many simultaneous connections can be opened using TCP and UDP ports? | 128k |
61 | Which of the following statements is a correct statement for “mouse release” event in “MouseListener” interface? | public void mouseReleased(MouseEvent me) |
62 | ______________ is/are not part of java core language. | ArrayList class |
63 | Strings in java are represented as ___________. | Reference data types |
64 | ________________ in a collection class creates a collection with no elements. | Constructor |
65 | == operator compare ____________ of strings whereas equals() method compare ________ of strings. | Addresses, values |
66 | Assume that we do not want to serialize phoneNum attribute of Personinfo class, this can be done by; | transient String phoneNum; |
67 | java program’s code is compiled into a form called | Byte code |
68 | Which command of the following commands is used to run “Java Test” Java file’s program? | java JavaTest |
69 | Java defines ___________ for the listener interfaces having more than one event handling methods. | Adapter classes |
70 | You must include a ______________ to declare an exception that might be thrown to another method. | throws-clause |
71 | If you want to animate something like ball, moving from one place to another, we constantly need to call paint () method. | False |
72 | In the context of Java Graphics, which of the following we should override while painting? | paintComponet() |
73 | Which of the following features is not available in Java? | Multiple inheritance |
74 | If a JPanel has a triangle drwan on it which of the following method will display it? | paintComponet() |
75 | Which of the following is correct java code statement that is used to establish the connection? | Connection con = DriverManager.getConnection(conURL) |
76 | Which of the following exception belongs to a category of checked exception? | IOException |
77 | A collection can store _____________. | Heterogeneous objects |
78 | Which of the following statement object is used to execute precompiled SQL statements? | PreparedStatment |
79 | Which of the following stream read/write data in the form of bytes? | FileInputStream |
80 | Which of the following method is used to execute INSERT, UPDATE and DELETE SQL statements | executeUpdate(sql); |
81 | HashMap takes key as a/an _____ | Object |
82 | ArrayList is an example of ___________ collection type | Sequence Based |
83 | If we want to animate something like ball, moving from one place to another, we constantly need to call paint () method. | False |
84 | Which of the following is a general purpose container? | JPanel |
85 | ResultSet provides various gathers to retrieve ________________. | Data of the column |
86 | In editor java programs are created while stored on/in ________________. | Disk |
87 | If a class needs to handle event generated by button then which of the following interface a class needs to implement? | ActionListner |
88 | Which of the following classes provide definitions for all the methods (empty bodies) of their corresponding Listener interface | Adapter Classes |
89 | Which of the following is called “pure abstract class” | Interface |
90 | A default ResultSet object has a cursor that __________________-. | Moves Forward Only |
91 | Which of the given will clear all the previous painting? | super.paintComponent() |
92 | Which of the following is NOT a method of ResultSet object? | executeQuery(sql) |
93 | Java defines _________ for the listener interfaces having more than one event handling methods | Adapter Classes |
94 | Which of the following feature is not included in Java? | addFocusListener |
95 | All AWT and swing component generate events | True |
96 | ___________________ is/are not part of jaca code language | ArrayList class |
97 | The collection API are defined in ___________ package. | Java.util |
98 | Which of the following statement object is used to execute precompiled SQL statements? | PreparedStatement |
99 | The _____________ is directly connected with keyboard | Node stream |
100 | Java does not handle execution by ___________ as keyword | Execution |
101 | Which of the following method is used to determine whether a database is read only or not? | isReadOnly() |
102 | HTTP works on port _______________- | 80 |
103 | DDL stands for? | Data Definition Language |
104 | Which of the following statement object is used to execute stored procedures? | CallableStatement |
105 | Which of the following package needs to be import while handling files> | ava.io |
106 | Socket is a _________ communication channel between hosts. | bi-directional |
107 | In Java, ______________ types of statement objects are available for sending SQL queries to the databases. | Three |
108 | A port is a ______________ to which processes can listen for connections request | Client Address |
109 | Java is a ________ language | complicated |
110 | An applet can be defined as _________________ | A small program written in java and included in an HTML page |
111 | Based on functionality, the stream can be categorized as ___________. | Node stream and filter stream |
112 | Bytecodes are created and stored on disk by________ | Compiler |
113 | Static methods can only access _____ | Static variables and methods |
114 | Which of the following classes provide definitions | |
115 | Which of the following classes provide definitions for all methods of their corresponding listener interface? | Adapter class |
116 | How many simultaneous connections can be open using TCP and UDP ports? | 128K |
117 | Strings in java are represented as__________ | Reference data type |
118 | In given lines of code Employee is a super class, Teacher is a child class, ________ is applying. Employee e= new Teacher(); | Downcasting teacher to employee type |
119 | The following is an example of _________, FileReader fr= new FileReader(“input.txt”); | Filter stream |
120 | Which of the following is called “pure abstract class”? | Interface |
121 | setColor is a method of ___________ image? | Graphics |
122 | If we want to call to String() method of parent class in java. Which of the following statement will be used? | super.toString() |
123 | In order to include graphics in your java program, it is mandatory to extend from ________class? | JPanel |
124 | Mouse events can be trapped for ______ GUI component? | All of given |
125 | What will happen is static modifier is removed from the signature of main method? | None of the given options |
126 | Windows, frames and dialogs use __________ as their default layout. | Border layouts |
127 | Exception handling code is written in _____. | Catch block |
128 | Suppose strings are store in a collection “arraylist”. Get one string element and store in element variable. Choose correct line of code for this requirement? | String element = (String)arraylist.get(i); |
129 | Converting a bigger data type into smaller data type is called_______ | Down casting |
130 | Which of the following method is used to convert a string into an int value? | parseInt() |
131 | Adapter class have been defined for listener interfaces except ______ interfaces. | Action listener |
132 | Which of the following is correct java code statement that is used to establish the connection? | Connection con = driverManager.getconnection(conURL) |
133 | Which of the following is a general purpose container? | JPanel |
134 | Which of the following package needs to be import while handling files? | java.io |
135 | Exception handling code is written in ___ | catch block |
136 | Which of the following stream is a Node stream? | FileWriter |
137 | Which of the following stream read/write data in the form of bytes? | FileInputStream |
138 | Which of the following command is used to compile Java code? | javac filename |
139 | Which of the following method is used to execute INSERT, UPDATE and Delete SQL statements? | executeUpdate(Sql); |
140 | Which of the following stream is a filter stream? | BufferedReader |
141 | An event in java is represented as ____ | Object |
142 | Which of the following belongs to a category of checked exception? | IOException |
143 | Packages are the way to organize files into different ————-according to their functionality, usability as well as category they should belong to. | Directories |
144 | When JSP page compiled, it is translated into? | Servlet |