Home / Ritu Nagar / Programming MCQs Solution

Programming Portal Solution

You will find all Programming Portal MCQs whose solution is updated by Ritu Nagar

Q. What will be the output of the following Java code? class Myexception extends Exception { int detail; Myexception(int a) { detail = a; } public String toString() { return "detail"; } } class Output { static void compute (int a) throws Myexception { throw new M

Q. Which of these handles the exception when no catch is used?

Q. Which keyword is used to specify the exception thrown by method?

Q. What will be the result after the class Test execution? class A{ public void doA(){ B b = new B(); b.dobB(); System.out.print("doA"); } } class B{ public void dobB(){ C c = new C(); c.doC(); System.ou

Q. What will be the output of the following Java code? class A { public int i; private int j; } class B extends A { void display() { super.j = super.i + 1; System.out.println(super.i + " " + super.j); } } class inheritance { public static vo

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(

Q. Which of these is a super class of wrappers Long, Character & Integer?

Q. Which of these class can encapsulate an entire executing program?

Q. Which of these classes is not included in java.lang?

Q. In Java, can an interface have private methods with implementations?

Q. In Java, can an abstract class have default methods with implementations?

Q. Given the following piece of code: public class School{ public abstract double numberOfStudent(); } which of the following statements is true?

Q. Which of these package provides the ability to read and write in Zip format?

Q. Which system property stores installation directory of JRE?

Q. What is the purpose of method overloading in Java?

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

Q. Which of these is correct about passing an argument by call-by-value process?

Q. What will be the output of the following Java program? class A { int i; public void display() { System.out.println(i); } } class B extends A { int j; public void display() { System.out.println(j); } } class Dynamic_dispatch { publ

Q. What is the purpose of the "implements" keyword in Java?

Q. What is the purpose of an abstract class in Java?

Q. What is the correct syntax to call a method named "myMethod" from an object "myObject"?

Q. What is a constructor in Java?

Q. Which method is called when an object is garbage collected in Java?

Q. Determine Output: class A{ public static void method(int i){ System.out.print("Method 1"); } public static int method(String str){ System.out.print("Method 2"); return 0; } } public class Test{ public static void main(String args[]){ A.method(5); } }

Q. class A{ A(String s){} A(){} } class B extends A{ B(){} B(String s){ super(s); } void test(){ // insert code here } } Which of the below code can be insert at line 7 to make clean compilation ?

Q. What is true about private constructor?

Q. Abstract class cannot have a constructor.

Q. What will be the output of the following Java program? class recursion { int fact(int n) { int result; if (n == 1) return 1; result = fact(n - 1) * n; return result; } } class Output { public static void main(String args[]) {

Q. Determine output:

Q. What is the order of precedence (highest to lowest) of following operators? 1. & 2. ^ 3. ?:

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

Q. In Java, what is the result of the expression "Hello".substring(1, 4)?

Q. How do you find the index of the last occurrence of a substring in a string in Java?

Q. What will be the output of the following Java code? class output { public static void main(String args[]) { StringBuffer s1 = new StringBuffer("Hello"); s1.insert(1,"Java"); System.out.println(s1); } }

Q. How do you declare a one-dimensional array in Java?

Q. What happens when you try to access an element at an index that is out of bounds in an ArrayList in Java?

Q. Which of the following access modifiers allows access to a class member from any class in any package?

Q. Which data type is used to store floating-point numbers with single precision in Java?

Q. What is the default value of a boolean variable in Java if it's not explicitly initialized?

Q. What will be the output of the following Java code snippet? double a = 0.02; double b = 0.03; double c = b - a; System.out.println(c); BigDecimal _a = new BigDecimal("0.02"); BigDecimal _b = new BigDecimal("0.03"); BigDecimal _c = b.subtract(_a); System.out.println(_c);

Q. What will be the output of the following Java code? class booloperators { public static void main(String args[]) { boolean var1 = true; boolean var2 = false; System.out.println((var1 & var2)); } }

Q. What will be the output of the following Java program? class evaluate { public static void main(String args[]) { int a[] = {1,2,3,4,5}; int d[] = a; int sum = 0; for (int j = 0; j < 3; ++j) sum += (a[j] * d[j + 1]) + (a[j + 1] * d[j]); System.out.println(sum)

Q. What will be the output of the following Java program? class mainclass { public static void main(String args[]) { char a = 'A'; a++; System.out.print((int)a); } }

Q. The logging option to enable binary log index file is . . . . . . . .

Q. Which type can store a collection of objects of any type?

Q. The system variable 'system_time_zone' can be reset at runtime.

Q. Which of these can be used to generate hash values?

Q. What causes a replication master server to delete all the binary log files even if they are still in use?

Q. Which of these is not optional? SELECT select_list FROM table_list WHERE row_constraint GROUP BY grouping_columns;

Q. The number of tables for which DELAYED works is . . . . . . . . MyISAM, MEMORY, ARCHIVE, BLACKHOLE

Q. Using indexes optimizes query performance.

Q. In the CREATE TABLE statement, the engine name specified is case insensitive.

Q. The following MySQL statement belongs to which "Condition Types"? SELECT emp_id, fname, lname FROM account WHERE start_date<’2007-10-08’;

Q. Installing more memory into the machine enables to configure larger values for cache server.

Q. What cannot be done on a view?

Q. Which data type is used to store data and time in Mysql?

Q. The TLS protocol is . . . . . . . .

Q. "SELECT" clause cannot be used without which clause in Mysql?

Q. How can we define the clause "FROM" in Mysql?

Q. What sets the association between one or more MyISAM tables and the named key cache?

Q. The return value from operations returning a row count is . . . . . . . .

Q. What does the default case sensitivity of database and table names depend on?

Q. Which data type is best suited to store currency values?

Q. Which keyword in the UPDATE statement is used to assign values to columns?

Q. In MyISAM tables, when a table is emptied with the TRUNCATE TABLE, the counter begins at . . . . . . . .

Q. Which mode is used to turn off the special meaning of backslash and treat it as an ordinary character?

Q. To how many of these does the LOW_PRIORITY modifier apply to? DELETE, INSERT, LOAD DATA, REPLACE

Q. If in Table "employee", a column "emp_id" consists of {1,2,2,3,3,5,6,7,8,8} then what will be the output on executing the following MySQL statement? SELECT DISTINICT emp_id FROM employee;

Q. What is abc in the following MySQL statement? CREATE VIEW xyz (abc) AS SELECT a FROM t;

Q. MySQL supports shared-memory connections on Windows.

Q. When building from source, the embedded server library is enabled by what?

Q. What is the value of val2 in the following MySQL statement? UPDATE t SET val1 = val1 + 2, val2 = val1;

Q. How many of the following take a connection handler as an argument? mysql_store_result(), mysql_use_result()

Q. Which of these return a result to the client?

Q. The operators used when a subquery returns multiple rows to be evaluated in comparison to the outer query are . . . . . . . .

Q. The maximum non zero value for FLOAT is . . . . . . . .

Q. Which data type is more suitable for storing "small notes" in Mysql?

Q. In a MyISAM table, if the maximum value of an AUTO_INCREMENT increment column is 12 and that row is deleted, the next value generated is . . . . . . . .

Q. Functions are called and pointers to structures are used while using DBI API.

Q. What can be used to check for views that have been invalidated by DROP or ALTER operations?

Q. Which among the following operators is/are belongs to "Inequality conditions"?

Q. What is the meaning of "GROUP BY" clause in Mysql?

Q. Fill the blanks with suitable options? BETWEEN . . . . . . . . AND . . . . . . . .

Q. In the following SQL command "person" stands for? SELECT person_id, fname, lname, Birth_date FROM person;

Q. REPAIR TABLE works with how many of the following? MyISAM, ARCHIVE, CSV

Q. Find the missing clause from the following SQL statement? CREATE VIEW person_1 AS SELECT fname, lname, person_id _________ person;

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

Q. The string function that returns the index of the first occurrence of substring is . . . . . . . .

Q. The number of values that can be returned from a given stored function is . . . . . . . .

Q. In the following SQL command "person_id" can be . . . . . . . . SELECT person_id, fname, lname, Birth_data FROM person WHERE person_id=1;

Q. OS imposes per process limits on the number of open file descriptors.

Q. Microsoft Office is an office suite, for the

Q. Microsoft Office is

Q. What does the term "NiFi Registry" refer to in the context of Apache NiFi?

Q. In NiFi, what is the purpose of the "InvokeHTTP" processor?

Q. In NiFi, what is the function of the "LookupAttribute" processor?

Q. In NiFi, what is the primary purpose of the "DetectDeadLetter" processor?

Q. In NiFi, what is the significance of the "ListSFTP" processor?

Q. How does Hadoop support encryption at rest for data stored in HDFS?

Q. How can you secure the communication between nodes in a Hadoop cluster using IPsec?

Q. How does Hadoop's Knox Gateway enhance security in a Hadoop cluster?

Q. How can Hadoop mitigate the risk of a Man-in-the-Middle (MITM) attack during data transmission?

Q. How does Hadoop's HDFS Trash feature contribute to security?

Q. Point out the wrong statement.

Q. Lucene index size is roughly . . . . . . . . the size of text indexed.

Q. How many types of modes are present in Hama?

Q. . . . . . . . . transport writes to a file.

Q. The . . . . . . . . class defines a configuration parameter named LINES_PER_MAP that controls how the input file is split.

Q. . . . . . . . . is where you would land a flow (or possibly multiple flows joined together) into an HDFS-formatted file system.

Q. Spark is engineered from the bottom-up for performance, running . . . . . . . . faster than Hadoop by exploiting in memory computing and other optimizations.

Q. Which of the following apache project is gaining a lot of traction steadily with the efforts of its committers?

Q. In HBase, what is the purpose of the HBase Compaction process?

Q. What is the significance of the HBase Snapshot Isolation feature?

Q. What is the purpose of the HBase MultiDatacenter Replication feature?

Q. In HBase, what is the purpose of the HBase Replication feature?

Q. What is the role of the HBase Load Balancer in HBase architecture?

Q. What is the significance of the Oozie Kill node in a workflow?

Q. Which of the following project will create an SOA services framework?

Q. A . . . . . . . . is a way of extending Ambari that allows 3rd parties to plug in new resource types along with the APIs.

Q. In Hive, what is the purpose of the JOIN statement?

Q. Point out the correct statement.

Q. Hive uses . . . . . . . . style escaping within the strings.

Q. Which of the following operator executes a shell command from the Hive shell?

Q. Which of the following will remove the resource(s) from the distributed cache?

Q. hiveconf variables are set as normal by using the following statement?

Q. The files that are written by the . . . . . . . . job are valid Avro files.

Q. Hive does not support literals for . . . . . . . . types.

Q. Hive uses . . . . . . . . for logging.

Q. What is the primary function of the Hadoop MultipleOutputs class?

Q. What is the purpose of the Hadoop CombineFileInputFormat?

Q. . . . . . . . . instances are encoded using the number of bytes declared in the schema.

Q. Which of the following will compile the Pigunit?

Q. . . . . . . . . method will be called by Pig both in the front end and back end to pass a unique signature to the Loader.

Q. What is the primary role of the Hadoop TaskTracker in a Hadoop cluster?

Q. What is the primary function of Apache Flume in Hadoop?

Q. Point out the wrong statement.

Q. A . . . . . . . . determines which data centers and racks nodes belong to it.

Q. A number of constants used in the client ZooKeeper API were renamed in order to reduce . . . . . . . . collision.

Q. Point out the correct statement.

Q. In a MapReduce application, what is the purpose of the Hadoop OutputFormat?

Q. In a MapReduce job, what does the term "Combiner" represent?

Q. In a MapReduce program, what is the purpose of the Hadoop Configuration object?

Q. What is the function of the Hadoop Mapper.Context in a MapReduce application?

Q. What is the role of the Hadoop TaskInputOutputContext in a MapReduce job?

Q. Jobs can enable task JVMs to be reused by specifying the job configuration . . . . . . . .

Q. Which of the following parameter is the threshold for the accounting and serialization buffers?

Q. Point out the wrong statement.

Q. Which of the following class provides a subset of features provided by the Unix/GNU Sort?

Q. In Hadoop, what is the purpose of the ResourceManager in YARN?

Q. What is the primary function of Apache ZooKeeper in Hadoop?

Q. What is the role of the Hadoop Secondary NameNode in HDFS?

Q. In advanced MapReduce, what is the significance of the Hadoop MapReduce "MapReduce speculative execution"?

Q. In advanced MapReduce, what is the primary purpose of the Hadoop MapReduce "OutputCommitter"?

Q. The Job makes a copy of the . . . . . . . . so that any necessary internal modifications do not reflect on the incoming parameter.

Q. . . . . . . . . checks whether the given key is deprecated.

Q. . . . . . . . . is used to store temporary data by programmers.

Q. Who displays the list of projects contained in current solution?

Q. Text that cannot be changed by the user is termed as . . . . . . . . text.

Q. What will be the output of the following Visual Basic code?

Q. In the following Visual Basic code, what will be in msg, if str contains "ik"?

Q. If the elements in two arrays are related by their subscripts, the arrays are called as . . . . . . . . arrays.

Q. What will be assigned to the dblAvg variable after the code has been executed? The intTotal, intSub, and dblAvg variables contain the number 0 before the loops are processed.

Q. frame is used to differentiate the one radio button group to another radio button group.

Q. Which is an easier alternative of multiple-alternative selection structure?

Q. Passing a variable's address is referred to as . . . . . . . .

Q. The . . . . . . . . in a Do...Loop statement can contain variables, methods, constants, properties and operators.

Q. Each menu element is considered as . . . . . . . .

Q. single dimensional array requires one indexes to identify a particular element.

Q. A control's KeyPress event occurs every time . . . . . . . .

Q. Which option is used to close the Solution?

Q. The . . . . . . . . is an abbreviation of the term sub procedure.

Q. What will be the content of num, after the code execution; if before code execution num has value 90?

Q. . . . . . . . . is a counter-controlled loop.

Q. Checkbox in an interface is labeled using . . . . . . . . property.

Q. The requirement for not repeating the instructions is referred to as the . . . . . . . .

Q. What will be the output of the following Visual Basic code?

Q. A . . . . . . . . occurs when you break the rules of the language.

Q. What is used to add a Label control to a form?

Q. . . . . . . . . is a programming language that allows the programmer to use objects to accomplish his goals.

Q. . . . . . . . . means to assign a beginning value to the counter or accumulator.

Q. . . . . . . . . is the process of finding & removing errors.

Q. Passing a copy of the variable is referred to as . . . . . . . .

Q. . . . . . . . . argument in the Substring syntax specifies number of characters you want to access.

Q. Which of the following is false?

Q. What will be the content of num, after code execution; if before code execution num has value 200?

Q. . . . . . . . . this control is use to display the images

Q. Which of the following statements is false?

Q. When a checkbox's . . . . . . . . property is set to true, it can both accept and display multiple lines of text.

Q. ADO is ActiveX-based, it can not work in different platforms and different programming languages.

Q. . . . . . . . . and . . . . . . . . methods are used to align characters in a String.

Q. The . . . . . . . . statement in pseudocode acts like loop.

Q. A button's caption is entered using . . . . . . . .

Q. . . . . . . . . is the default Visual Basic data type

Q. A variable declared as . . . . . . . . type can store both values and it can store date values 01/01/0100 up to 12/31/9999

Q. The intSales array is declared as follows: Dim intSales() As Integer = {10000, 12000, 900, 500, 20000}. The statement intSales(3) = intSales(3) + 10 will .

Q. In the following code, the while loop will execute if strId would have been . . . . . . . . Do While strId Like "###*"

Q. . . . . . . . . Displays a list of items from which a user can select one.

Q. To include an image on the form we use which toolbox?

Q. 'e' parameter's . . . . . . . . property is used to determine the pressed key.