SAS and Java Programming Quiz

A quiz covering SAS programming components, history, and features along with Java programming concepts including classes, constructors, and object references.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

The keyword __________ is required to declare a class.

  1. public
  2. private
  3. class
  4. All of the above.
Question 2 Multiple Choice (Single Answer)

class TempClass { int i; public void TempClass(int j) { int i = j; } } public class C { public static void main(String[] args) { TempClass temp = new TempClass(2); } }

  1. The program has a compilation error because TempClass does not have a default constructor.
  2. The program has a compilation error because TempClass does not have a constructor with an int argument.
  3. The program compiles fine, but it does not run because class C is not public.
  4. The program compiles and runs fine.
Question 3 Multiple Choice (Single Answer)

Given the declaration Circle x = new Circle(), which of the following statement is most accurate.

  1. x contains an int value
  2. x contains an object of the Circle type.
  3. x contains a reference to a Circle object.
  4. You can assign an int value to x.
Question 4 Multiple Choice (Single Answer)

Analyze the following code. public class Test { int x; public Test(String t) { System.out.println("Test"); } public static void main(String[] args) { Test test = null; System.out.println(test.x); } }

  1. The program has a syntax error because test is not initialized.
  2. The program has a syntax error because x has not been initialized.
  3. The program has a syntax error because you cannot create an object from the class that defines the object.
  4. The program has a syntax error because Test does not have a default constructor.
  5. The program has a runtime NullPointerException because test is null while executing test.x.
Question 5 Multiple Choice (Single Answer)

The default value for data field of a boolean type, numeric type, object type is ___________, respectively.

  1. true, 1, Null
  2. false, 0, null
  3. true, 0, null
  4. true, 1, null
Question 6 Multiple Choice (Single Answer)

Analyze the following code: public class Test { public static void main(String[] args) { double radius; final double PI= 3.15169; double area = radius * radius * PI; System.out.println("Area is " + area); } }

  1. The program has syntax errors because the variable radius is not initialized.
  2. The program has a syntax error because a constant PI is defined inside a method.
  3. The program has no syntax errors but will get a runtime error because radius is not initialized.
  4. The program compiles and runs fine
Question 7 Multiple Choice (Single Answer)

Analyze the following code. public class Test { int x; public Test(String t) { System.out.println("Test"); } public static void main(String[] args) { Test test = new Test(); System.out.println(test.x); } }

  1. The program has a syntax error because System.out.println method cannot be invoked from the constructor.
  2. The program has a syntax error because x has not been initialized.
  3. The program has a syntax error because you cannot create an object from the class that defines the object.
  4. The program has a syntax error because Test does not have a default constructor.
Question 8 Multiple Choice (Single Answer)

Variables that are shared by every instances of a class are __________.

  1. public variables
  2. private variables
  3. instance variables
  4. class variables
Question 9 Multiple Choice (Single Answer)

You should add the static keyword in the place of ? in Line ________ in the following code:

  1 public class Test {   2 private int age;  3   4 public ? int square(int n) {   5 return n * n;  6 }  7  8 public ? int getAge() {  9 }  10}

  1. in line 4
  2. in line 8
  3. in both line 4 and line 8
  4. none
Question 10 Multiple Choice (Single Answer)

SAS programming language is a

  1. 3rd generation programming language
  2. 4th generation programming language
  3. 5th generation programming language
  4. All of the above
Question 11 Multiple Choice (Single Answer)

SAS was conceived by

  1. Anthony J. Barr
  2. James Goodnight
  3. John Sall
  4. Caroll G. Perkins
Question 12 Multiple Choice (Single Answer)

Which of the following is not a SAS components

  1. Base SAS
  2. SAS Enterprise Business Intelligence Server
  3. SAS/ACCESS
  4. SAS Toolware Studio Administrator
Question 13 Multiple Choice (Single Answer)

First limited release of the SAS system

  1. SAS 60
  2. SAS 71
  3. SAS 10.0
  4. SAS 1S
Question 14 Multiple Choice (Single Answer)

Which Component of SAS provides the ability to transparently share data with non-native datasources

  1. Enterprise Miner
  2. SAS/ACCESS
  3. SAS/SCL
  4. SAS/CONNECT
Question 15 Multiple Choice (Single Answer)

SAS had been criticized for its poor graphics, In which version the graphics improved significantly.

  1. SAS 6
  2. SAS 7
  3. SAS 8
  4. SAS 9
Question 16 Multiple Choice (Single Answer)

Location of SAS's Worldwide Headquarters

  1. Cary,NC,USA
  2. Churchgate,Mumbai,India
  3. Ontario,Canada
  4. NYC,New York,USA
Question 17 True/False

SAS Institute has its own book publishing arm, known as SAS Press.True or False.

  1. True
  2. False
Question 18 Multiple Choice (Single Answer)

The goal of this product is to compete with Business Objects and Cognos' offerings.

  1. OLAP Cube Studio
  2. SAS/CONNECT
  3. Enterprise Guide
  4. SAS Enterprise Business Intelligence Server
Question 19 Multiple Choice (Single Answer)

What is SAS/SCL?

  1. Allows SAS to transparently share data with personal computer applications including MS Access and Microsoft Office Excel
  2. A plugin for Information Delivery Portal. It allows the user to create various graphics that represent a broad range of data. This allows a quick glance to provide a lot of information, without having to look at all the underlying data.
  3. Allows programmers to create and compile object-oriented programs.
  4. A client application that helps with building information maps.
Question 20 Multiple Choice (Multiple Answers)

Which of the following is not a group function?

  1. avg( )
  2. sqrt( )
  3. sum()
  4. max()