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.
Questions
The keyword __________ is required to declare a class.
- public
- private
- class
- All of the above.
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); } }
- The program has a compilation error because TempClass does not have a default constructor.
- The program has a compilation error because TempClass does not have a constructor with an int argument.
- The program compiles fine, but it does not run because class C is not public.
- The program compiles and runs fine.
Given the declaration Circle x = new Circle(), which of the following statement is most accurate.
- x contains an int value
- x contains an object of the Circle type.
- x contains a reference to a Circle object.
- You can assign an int value to x.
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); } }
- The program has a syntax error because test is not initialized.
- The program has a syntax error because x has not been initialized.
- The program has a syntax error because you cannot create an object from the class that defines the object.
- The program has a syntax error because Test does not have a default constructor.
- The program has a runtime NullPointerException because test is null while executing test.x.
The default value for data field of a boolean type, numeric type, object type is ___________, respectively.
- true, 1, Null
- false, 0, null
- true, 0, null
- true, 1, null
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); } }
- The program has syntax errors because the variable radius is not initialized.
- The program has a syntax error because a constant PI is defined inside a method.
- The program has no syntax errors but will get a runtime error because radius is not initialized.
- The program compiles and runs fine
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); } }
- The program has a syntax error because System.out.println method cannot be invoked from the constructor.
- The program has a syntax error because x has not been initialized.
- The program has a syntax error because you cannot create an object from the class that defines the object.
- The program has a syntax error because Test does not have a default constructor.
Variables that are shared by every instances of a class are __________.
- public variables
- private variables
- instance variables
- class variables
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}
- in line 4
- in line 8
- in both line 4 and line 8
- none
SAS programming language is a
- 3rd generation programming language
- 4th generation programming language
- 5th generation programming language
- All of the above
SAS was conceived by
- Anthony J. Barr
- James Goodnight
- John Sall
- Caroll G. Perkins
Which of the following is not a SAS components
- Base SAS
- SAS Enterprise Business Intelligence Server
- SAS/ACCESS
- SAS Toolware Studio Administrator
First limited release of the SAS system
- SAS 60
- SAS 71
- SAS 10.0
- SAS 1S
Which Component of SAS provides the ability to transparently share data with non-native datasources
- Enterprise Miner
- SAS/ACCESS
- SAS/SCL
- SAS/CONNECT
SAS had been criticized for its poor graphics, In which version the graphics improved significantly.
- SAS 6
- SAS 7
- SAS 8
- SAS 9
Location of SAS's Worldwide Headquarters
- Cary,NC,USA
- Churchgate,Mumbai,India
- Ontario,Canada
- NYC,New York,USA
SAS Institute has its own book publishing arm, known as SAS Press.True or False.
- True
- False
The goal of this product is to compete with Business Objects and Cognos' offerings.
- OLAP Cube Studio
- SAS/CONNECT
- Enterprise Guide
- SAS Enterprise Business Intelligence Server
What is SAS/SCL?
- Allows SAS to transparently share data with personal computer applications including MS Access and Microsoft Office Excel
- 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.
- Allows programmers to create and compile object-oriented programs.
- A client application that helps with building information maps.
Which of the following is not a group function?
- avg( )
- sqrt( )
- sum()
- max()