0

programming languages Online Quiz - 197

Description: programming languages Online Quiz - 197
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

Which of the following design patterns reduces the coupling between presentation-tier clients and business services in a web application?

  1. Value Objects

  2. MVC

  3. Data Access Object

  4. Business Delegate


Correct Option: D

Which of the following statements regarding GET and POST methods are true?

  1. GET is the method commonly used to request a resource from the server

  2. POST is the method commonly used to request a resource from the server.

  3. GET is the method commonly used for passing user input to the server

  4. POST is the method commonly used for passing user input to the server


Correct Option: A

if(check4Biz(storeNum) != null) {} Referring to the above, what datatype could be returned by method check4Biz()?

  1. boolean

  2. int

  3. String

  4. char


Correct Option: C

AI Explanation

To answer this question, we need to understand the return type of the method check4Biz().

Based on the given code snippet if(check4Biz(storeNum) != null) {}, we can infer that the method check4Biz() is returning a reference type that can be compared to null.

Let's go through each option to determine the correct return type:

Option A) boolean - This option is incorrect because a boolean value cannot be compared to null. It can only have the values true or false.

Option B) int - This option is incorrect because an int value also cannot be compared to null. It can only hold numeric values.

Option C) String - This option is correct because a String is a reference type that can be compared to null. It can hold text values and can be compared to null to check if it is empty or uninitialized.

Option D) char - This option is incorrect because a char value cannot be compared to null. It can only hold single character values.

Therefore, the correct answer is C) String. The method check4Biz() is expected to return a String datatype.

The following expression……….char c = -1;

  1. will cause a compiler error as the range of character is between 0 and 2^16 - 1. Will request for an explicit cast.

  2. will not cause a compiler error and c will have the value -1;

  3. c will not represent any ASCII character.

  4. c will still be a Unicode character.


Correct Option: A

All the wrapper classes (Integer, Boolean, Float, Short, Long, Double and Character)

  1. are public

  2. are serializable

  3. are immutatable

  4. extend java.lang.Number


Correct Option: C

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) All the wrapper classes (Integer, Boolean, Float, Short, Long, Double, and Character) are public. This option is correct because all the wrapper classes in Java are indeed public.

Option B) All the wrapper classes (Integer, Boolean, Float, Short, Long, Double, and Character) are serializable. This option is incorrect because not all the wrapper classes are serializable. Only a few wrapper classes, such as Integer, Float, Double, and Character, are serializable.

Option C) All the wrapper classes (Integer, Boolean, Float, Short, Long, Double, and Character) are immutable. This option is correct because all the wrapper classes in Java are immutable. This means that once an object of a wrapper class is created, its value cannot be changed.

Option D) All the wrapper classes (Integer, Boolean, Float, Short, Long, Double, and Character) extend java.lang.Number. This option is incorrect because not all the wrapper classes extend from the java.lang.Number class. Only a few wrapper classes, such as Integer, Float, Short, Long, Double, extend java.lang.Number.

The correct answer is C) All the wrapper classes (Integer, Boolean, Float, Short, Long, Double, and Character) are immutable. This option is correct because all the wrapper classes in Java are indeed immutable.

Two important files which restrict crontab function/operations

  1. cronallow.ksh and crondeny.ksh

  2. cronallow.sh and crondeny.sh

  3. cron_allow AND cron_deny

  4. cron.allow AND cron.deny


Correct Option: D

Which of the following statements uses embedded dynamic SQL?

  1. SELECT col1 INTO :hv from table1

  2. EXECUTE IMMEDIATE SELECT col1 INTO :hv FROM table1

  3. DECLARE c1 CURSOR FOR s1

  4. IMMEDIATE SELECT col1 INTO :hv FROM table1


Correct Option: B

What is the difference between a TextArea and a TextField?

  1. A TextArea can handle multiple lines of text

  2. A textarea can be used for output

  3. TextArea is not a class

  4. TextAreas are used for displaying graphics


Correct Option: A

How many statements does the program below contain? proc sql; select grapes,oranges, grapes + oranges as sumsales from sales.produce order by sumsales;

  1. two

  2. three

  3. four

  4. five


Correct Option: A

Which of the following statements is false wrt Improving Query Performance.

  1. Omitting the ORDER BY clause when you create tables and views improve the query performance.

  2. using joins instead of subqueries improve the query performance.

  3. A good practice to improve query performance is using WHERE expressions to limit the size of result tables created with joins.

  4. Must use the ORDER BY clause when you create tables and views.


Correct Option: D

The RESET statement enables you to add, drop, or change the options in PROC SQL without restarting the procedure.True or False?

  1. True

  2. False


Correct Option: B

Which of the following correctly creates a macro variable in a PROC SQL step?

  1. call symput(daily_fee, put(fee/days, dollar8.);

  2. %let daily_fee=put(fee/days, dollar8.)

  3. select fee/days format=dollar8. into :daily_fee from sasuser.a

  4. select fee/days format=dollar8. into daily_fee from sasuser.all;


Correct Option: C

What option is used with PROC FORMAT to document the formats in a particular format catalog?

  1. FMTSEARCH

  2. FMTERR

  3. CATALOG

  4. FMTLIB


Correct Option: D

AI Explanation

To answer this question, you need to understand the different options available with the PROC FORMAT statement in SAS.

Option A) FMTSEARCH - This option is incorrect because it is used to specify one or more format catalogs to search for formats. It is not used to document the formats in a particular format catalog.

Option B) FMTERR - This option is incorrect because it is used to specify whether error messages are generated when a format is not found or when a format is found but it cannot be applied.

Option C) CATALOG - This option is incorrect because it is used to specify the name of the format catalog to create or modify, but it is not used to document the formats in a particular format catalog.

Option D) FMTLIB - This option is correct because it is used with PROC FORMAT to document the formats in a particular format catalog. It specifies the name of the format catalog to be documented.

The correct answer is D) FMTLIB. This option is correct because it is used to document the formats in a particular format catalog.

Which statement about using the MODIFY statement in a DATA step is true?

  1. MODIFY creates a second copy of the data while variables in the data are being matched with a WHERE clause and then deletes the second copy.

  2. You cannot modify the descriptor portion of the data set using the MODIFY statement

  3. You can use the MODIFY statement to change the name of a variable.

  4. If the system terminates abnormally while a DATA step that is using the WHERE statement is processing, SAS automatically saves a copy of the unaltered data set.


Correct Option: B

Which of the clauses in the PROC SQL program below is written incorrectly? proc sql; select style sqfeet bedrooms from choice.houses where sqfeet ge 800;

  1. SELECT

  2. FROM

  3. WHERE

  4. both a and c


Correct Option: A

Given the following PROC FORMAT step, how is the value 70 displayed when the AGEGRP. format is applied? proc format; picture agegrp 1-<13=’00 Youth’ 13-<20=’00 Teen’ 20-<70=’00 Adult’ 70-high=’000 Senior’; run;

  1. 000 Senior

  2. 70 Adult

  3. 70 Senior

  4. 070 Senior


Correct Option: C

Given the following PROC FORMAT step, how is the value 6.1 displayed when the SKICOND format is applied? proc format; value skicond 0-3=’Poor’ 3

  1. 6.1

  2. Fair

  3. Good

  4. . (Missing)


Correct Option: C

Given the following program, which variable names will appear in the data set Work.New? proc transpose data=work.revenue out=work.new; run; Dataset : Obs Year Jan Feb Mar Apr 1 2000 1234 56345 2445 234676 2 2001 67676 787 7878 343535 3 2002 56736 89890 676 7878

  1. Year, Jan, Feb, Mar, Apr

  2. Year, 2000, 2001, 2002

  3. NAME, Col1, Col2, Col3

  4. NAME, Jan, Feb, Mar, Apr


Correct Option: C

Which statements about JDBC are true?

  1. JDBC is an API to connect to relational-, object- and XML data sources

  2. JDBC stands for Java DataBase Connectivity

  3. JDBC is an API to access relational databases, spreadsheets and flat files

  4. JDBC is an API to bridge the object-relational mismatch between OO programs and relational


Correct Option: B,C

Which packages contain the JDBC classes?

  1. java.jdbc and javax.jdbc

  2. java.jdbc and java.jdbc.sql

  3. java.sql and javax.sql

  4. java.rdb and javax.rdb


Correct Option: C

AI Explanation

To answer this question, we need to understand that JDBC (Java Database Connectivity) is a Java API that provides a standard way to interact with relational databases. The JDBC classes are part of the Java standard library and are contained in the java.sql package.

Let's go through each option to understand why it is correct or incorrect:

Option A) java.jdbc and javax.jdbc - This option is incorrect because there is no package named java.jdbc or javax.jdbc. The correct package is java.sql.

Option B) java.jdbc and java.jdbc.sql - This option is incorrect because there is no package named java.jdbc.sql. The correct package is java.sql.

Option C) java.sql and javax.sql - This option is correct because the JDBC classes are contained in the java.sql package. The javax.sql package also contains additional JDBC-related classes and interfaces.

Option D) java.rdb and javax.rdb - This option is incorrect because there is no package named java.rdb or javax.rdb. The correct package is java.sql.

The correct answer is C. The JDBC classes are contained in the java.sql package, and the javax.sql package contains additional JDBC-related classes and interfaces.

- Hide questions