Home / Sandhya Thakur / Programming MCQs Solution

Programming Portal Solution

You will find all Programming Portal MCQs whose solution is updated by Sandhya Thakur

Q. In Java, can a method declare multiple exceptions using the "throws" keyword?

Q. What is the result of the following code snippet? try { String str = "Java"; int num = Integer.parseInt(str); } catch (NumberFormatException e) { System.out.println("NumberFormatException!"); } catch (Exception e) { System.out.println("Exception!"); } finally { System.

Q. In Java, can a method declare both "throws" and "throw" statements?

Q. Which of these keywords must be used to monitor for exceptions?

Q. Which of these methods is used to print stack trace?

Q. Which of these keywords is used to by the calling function to guard against the exception that is thrown by called function?

Q. What is inheritance in Java?

Q. In Java, can a subclass have more than one superclass?

Q. What is the result of the following code snippet? class Parent { void display() { System.out.println("Parent"); } } class Child extends Parent { public static void main(String[] args) { Child obj = new Child(); obj.display(); } }

Q. What is the output of the following program code? abstract class C1{ public C1(){ System.out.print(1); } } class C2 extends C1{ public C2(){ System.out.print(2); } } class C3 extends C2{ public C3(){ System.out.println(3); } } public class Test{ public static void main(St

Q. Which of these is specified by a File object?

Q. Which of the following is method of System class is used to find how long a program takes to execute?

Q. Standard output variable 'out' is defined in which class?

Q. What is the signature of Math.random() method?

Q. Which of these class allows us to get real time data about private and protected member of a class?

Q. What will be the output of the following Java code? class isNaN_output { public static void main(String args[]) { Double d = new Double(1 / 0.); boolean x = d.isNaN(); System.out.print(x); } }

Q. What will be the output of the following Java program? import java.lang.System; class Output { public static void main(String args[]) { long start, end; start = System.currentTimeMillis(); for (int i = 0; i < 10000000; i++); end = System.currentTim

Q. What will be the output of the following Java program? class Output { public static void main(String args[]) { char a[] = {'a', '5', 'A', ' '}; System.out.print(Character.isDigit(a[0]) + " "); System.out.print(Cha

Q. In Java, declaring a class abstract is useful

Q. What type of methods an interface contain by default?

Q. What will be the output of the following Java code? import java.io.*; class files { public static void main(String args[]) { File obj = new File("/java/system"); System.out.print(obj.getName()); } }

Q. Which of these class defines how the classes are loaded?

Q. What will be the output of the following Java program? import java.util.*; class LOCALE_CLASS { public static void main(String args[]) { Locale obj = new Locale("HINDI", "INDIA") ; System.out.print(obj.getDisplayLanguage()); } }

Q. Which of this package is used for handling security related issues in a program?

Q. What does an interface contain?

Q. What will be the output of the following Java program? class exception_handling { public static void main(String args[]) { try { int a = args.length; int b = 10 / a; System.out.print(a); try { if

Q. Which of these values are returns under the case of normal termination of a program?

Q. In method overloading, what must be different between the overloaded methods in the same class?

Q. In Java, can a subclass override a protected method from its superclass?

Q. What is the process of defining a method in terms of itself, that is a method that calls itself?

Q. In Java, can an abstract class be instantiated?

Q. Which access modifier is used for a method that can be accessed from any class in the same package?

Q. In Java, what does the "final" keyword indicate when used with a method?

Q. What will be the output of the following Java code? class area { int width; int length; int area; void area(int width, int length) { this.width = width; this.length = length; } } class Output { public static void main(String args[]) { a

Q. What is the value of the expression 7 % 3 in Java?

Q. Which operator is used for string concatenation in Java?

Q. What will be the output?

Q. What will be the output of the following Java program?

Q. What is the valid data type for variable "a" to print "Hello World"?

Q. Which of the following is true about Java strings?

Q. Which of this method of class StringBuffer is used to reverse sequence of characters?

Q. Which of these methods is an alternative to getChars() that stores the characters in an array of bytes?

Q. How do you check if an element exists in an array or ArrayList in Java?

Q. A package is a collection of

Q. Which statements are most accurate regarding the following classes? class A{ private int i; protected int j; } class B extends A{ private int k; protected int m; }

Q. What is the result of compiling and running the following code? public class Tester{ static int x = 4; public Tester(){ System.out.print(this.x); // line 1 Tester(); } public static void Tester(){ // line 2 System.out.print(this.x); // line 3 } public static void main(String... args){ //

Q. In Java, which data type is used to store numbers with decimal points and greater precision than float?

Q. Which of the following is not provided by BigDecimal?

Q. Which of these comparisons is slowest?

Q. In Boolean search, results are sorted by relevance.

Q. The REAL type is synonym for . . . . . . . .

Q. To check if the data directory contains insecure files or directories, the command executed is . . . . . . . .

Q. "Numeric Data" is used to store . . . . . . . .

Q. The option that enables multiple-statement execution is . . . . . . . .

Q. Which clause is used to sort query elements?

Q. Which option is used for specifying the executable name while compiling with gcc?

Q. The language that is the core for APIs and communication in MySQL is . . . . . . . .

Q. The mode used to turn on strict mode and all of the additional restrictions is . . . . . . . .

Q. The statement that exits a labeled flow-control construct is . . . . . . . .

Q. Which statement is used to verify optimizer operation?

Q. The place where the server stores its databases and status files are the database directory.

Q. Which program converts binary log files to statements in text form?

Q. Multiple MySQL servers can be easily run on the same machine.

Q. The log in which data changes received from a replication master server are written are . . . . . . . .

Q. What does CGI stand for?

Q. What will be the output of the following MySQL statement? SELECT emp_id, fname, lname FROM employee WHERE LEFT (lname, 1) =’F’;

Q. If a column contains 7 values and 6 distinct values, the cardinality is . . . . . . . .

Q. The key declares that an index in one table is related to that in another is called . . . . . . . .

Q. In MySQL, identifier names can start with a digit.

Q. Which statement is used to remove a trigger?

Q. xyz in the following MySQL statement is . . . . . . . . CREATE VIEW xyz AS SELECT a, b FROM t;

Q. The LOCAL capability for LOAD DATA does not need to be enabled explicitly.

Q. The datatype best suited to store currency values is . . . . . . . .

Q. What is used to reload a delimited text data file?

Q. Which option repairs MyISAM tables automatically after they open?

Q. TO enable the compressed client/server protocol the option is . . . . . . . .

Q. The myisamchk variable that represents the size of buffer used to hold index blocks is . . . . . . . .

Q. How many of the following shared tablespaces is bound by the OS file size limit? MyISAM, InnoDB, TRANSACTION

Q. Is "Datetime" and "Timestamp" are same data type?

Q. Which among the following have the maximum bytes?

Q. The function returning reference to hash of row values is . . . . . . . .

Q. Foreign keys can handle deletes and updates.

Q. The 'C' in the ACID property of transactions is . . . . . . . .

Q. MySQL stores the database character set and collation attributes in the file . . . . . . . .

Q. On UNIX, statements entered in 'MySQL' are saved in which file?

Q. "COUNT" keyword belongs to which categories in Mysql?

Q. The clause that can be used to sort string values according to a specific collation is . . . . . . . .

Q. Which program emulates the client load for a MySQL server?

Q. What executes on a time activated basis according to a schedule?

Q. Which classes does spatial data types in MySQL correspond to?

Q. What is the default format for "Year" data type?

Q. The following MySQL query belongs to which condition types? SELECT fname FROM person WHERE title=’TELLER’;

Q. The expression 'HI' LIKE NULL results in . . . . . . . .

Q. Which keyword is used for sorting the data in ascending order in Mysql?

Q. To maintain performance of tables having variable length rows, which statement is used?

Q. To minimize disk I/O, which of these should be chosen? CHAR, VARCHAR

Q. Microsoft Office Document Imaging is

Q. In NiFi, what is the role of the "ConvertAvroToJSON" processor?

Q. How does Hadoop's Transparent Data Encryption (TDE) enhance security in HDFS?

Q. How does Hadoop's Ranger support security in Hadoop clusters?

Q. What is the purpose of Hadoop's Knox Gateway in a Hadoop security context?

Q. Which of the following can be used to launch Spark jobs inside MapReduce?

Q. The first call on the HCatOutputFormat must be . . . . . . . .

Q. . . . . . . . . phase merges the counts for unique ngrams or ngram fragments across multiple documents.

Q. Apache Flume 1.3.0 is the fourth release under the auspices of Apache of the so-called . . . . . . . . codeline.

Q. . . . . . . . . leverages Spark Core fast scheduling capability to perform streaming analytics.

Q. Point out the correct statement.

Q. For Scala users, there is the . . . . . . . . API, which is built on top of the Java APIs.

Q. Lucene provides scalable, high-Performance indexing over . . . . . . . . per hour on modern hardware.

Q. What is the primary function of the HBase Scanner in HBase?

Q. In HBase, what is the purpose of the HBase MultiVersion Concurrency Control (MVCC)?

Q. What is the role of the HBase Coprocessor Endpoints in HBase?

Q. HDT has been tested on . . . . . . . . and Juno, and can work on Kepler as well.

Q. HDT provides wizards for creating Java Classes for . . . . . . . .

Q. . . . . . . . . includes a flexible and powerful toolkit for displaying monitoring and analyzing results.

Q. If Ambari Agent has any output in /var/log/ambari-agent/ambari-agent.out, it is indicative of a . . . . . . . . problem.

Q. Point out the wrong statement.

Q. Point out the correct statement.

Q. The . . . . . . . . suffers from the monotonically increasing rowkey problem.

Q. What is the purpose of the Hadoop InputFormat?

Q. What is the role of the Hadoop AvroInputFormat?

Q. . . . . . . . . class accepts the values that the ModelCountMapper object has collected.

Q. Gzip (short for GNU zip) generates compressed files that have a . . . . . . . . extension.

Q. What is the purpose of the Pig Latin FILTER statement?

Q. Which of the following command can be used for debugging?

Q. Which of the following scripts that generate more than three MapReduce jobs?

Q. What is the primary function of the Hadoop Secondary NameNode in a Hadoop cluster?

Q. What is the primary role of the Sqoop Job tool?

Q. What is the primary role of the Flume Agent in the Flume architecture?

Q. . . . . . . . . serves distributed Lucene indexes in a grid environment.

Q. Cassandra creates a . . . . . . . . for each table, which allows you to symlink a table to a chosen physical drive or data volume.

Q. Which of the following class is used for general processing of error?

Q. . . . . . . . . encapsulates a set of delimiters used to encode a record.

Q. In a MapReduce program, what does the term "InputSplit" represent?

Q. Which of the following is not a table scope operator?

Q. What does the term "Hadoop ecosystem" refer to?

Q. . . . . . . . . is the most popular high-level Java API in Hadoop Ecosystem

Q. . . . . . . . . part of the MapReduce is responsible for processing one or more chunks of data and producing the output results.

Q. Hadoop has a library class, org.apache.hadoop.mapred.lib.FieldSelectionMapReduce, that effectively allows you to process text data like the unix . . . . . . . . utility.

Q. . . . . . . . . maps input key/value pairs to a set of intermediate key/value pairs.

Q. Which component in Hadoop is responsible for processing and analyzing data?

Q. What is the purpose of Hadoop ZooKeeper in the architecture?

Q. Which programming paradigm is central to Hadoop processing?

Q. In advanced MapReduce, what is the role of the Hadoop Job History Server?

Q. What is the purpose of the Hadoop Distributed Cache in MapReduce?

Q. In advanced MapReduce, what is the purpose of the Hadoop MapReduce "Map Output Sorting"?

Q. Point out the wrong statement.

Q. . . . . . . . . get events indicating completion (success/failure) of component tasks.

Q. . . . . . . . . is a data migration tool added for archiving data.

Q. . . . . . . . . method clears all keys from the configuration.

Q. The . . . . . . . . is a framework-specific entity that negotiates resources from the ResourceManager.

Q. reduceProgress() gets the progress of the job's reduce-tasks, as a float between . . . . . . . .

Q. The . . . . . . . . operator returns the remainder of the division.

Q. To make text appear around image . . . . . . . . section is used.

Q. In VB, A . . . . . . . . returns a value and a Sub Procedure does not return a value.

Q. When you start an application, the computer sends the focus to the control whose TabIndex is . . . . . . . .

Q. You use the . . . . . . . . constant to include the Exclamation icon in a message box.

Q. You can set the control's tab index property using . . . . . . . .

Q. A . . . . . . . . is a word that has special meaning in computer language.

Q. In VB, . . . . . . . . is used to enter the more then one value in a single variable having different data types.

Q. The variable name is also termed as . . . . . . . .

Q. Set the identifying labels tab index property that is . . . . . . . . than text box's tab index property.

Q. . . . . . . . . is the default name assigned to the label control.

Q. A button's . . . . . . . . event is used to run code.

Q. The. . . . . . . . Control is another control that handles images and pictures

Q. . . . . . . . . method is used to remove space from beginning and end of a string.

Q. To create menu on MDI form, we have to select . . . . . . . .

Q. Option Strict On disallows conversion of Double data type to . . . . . . . . implicitly.

Q. Following properties is use full to link ms-access in ADODC.

Q. Which box contains the name of the selected object?

Q. In VB, The while loop is end by . . . . . . . .

Q. When you have a loop within a loop, then you have created a . . . . . . . ..

Q. If array is of String type all values are . . . . . . . . by default.

Q. The intSales array is declared as follows: Dim intSales() As Integer = {10000, 12000, 900, 500, 20000}. Which of the following If clauses determines whether the intSub variable contains a valid subscript for the array?

Q. Programmers use . . . . . . . . known as loops.

Q. To delay program execution, you can use the . . . . . . . .

Q. A simple variable, also called as a . . . . . . . . variable, is one that is unrelated to any other variable in memory.

Q. Which of the following extension is used to represent the project file in Visual Basic?

Q. In Visual Basic if we declare a variable without any data type by . . . . . . . .this the data type is assigned as default..

Q. All Code in Visual Basic is stored in the form of. . . . . . . .

Q. Which of the following is used to display a message box in Visual Basic?

Q. The . . . . . . . . allows us to browse through the various properties, events and methods that are made available to us

Q. The main Property of check box is . . . . . . . .

Q. Which is used to restore a property's value?

Q. The . . . . . . . . is show under or below the Project Explorer window

Q. Which box displays the current values of each of the properties?

Q. What will be the output of the following R code? > mean(x) Error in mean(x) : object 'x' not found > traceback()

Q. Point out the correct statement?

Q. Which of the following R code creates a connection to 'foo.txt'?