programming languages Online Quiz - 40
programming languages Online Quiz - 40
Questions
There are 4 divisions in a cobol program. Which of the following is not one of them?
- Identification Division
- Linkage Division
- Data Division
- Procedure Division
Cobol is self-documenting.
- True
- False
User defined names must follow which one of the following rules?
- Multiple word names must be separated with an underscore
- Names must be 10 or less characters
- Names must contain at least 1 alpha character in any position.
- Names must be lower case
Cobol paragraphs contain sentences. A sentence must end in a period and can contain multiple statements.
- True
- False
Sentences and statements must start on a new line.
- True
- False
When defining a file layout it is placed in the file section of the data division. Each record begins with an "01", a space, and the record name. Fields within a record traditionally began with 05?
- All of these answers.
- This is an alternate name for the 05 name.
- This is a breakdown of the 05 field.
- This is another format for the field.
Condition names are names associated with a field that take on a true/false status depending on whether their value is equal to the field value. They are indicated by a level number of what?
- 05
- 66
- 88
- 77
If a field is defined as Pic s9(6)v99 comp-3, it uses 5 bytes of storage.
- True
- False
If we are limited to 5 bytes of storage, is there be a way to store a complete 8 digit date?
- True
- False
You store it as YYYYMMDD in 8 bytes. What is the COBOL definition of this field?
- Pic Y(4)M(2)D(2)
- Pic date(yyyymmdd)
- Pic date(8)
- Pic X(8)
class PrintTest{ public static void main(String[] args) { double d=222.4578; System.out.printf(“% .2f”,d); } }
- Does not compile
- Throws IllegalFormatConversionException
- Prints 222.46
- Prints 222.45
What is the result of compiling and running the following code, assuming that the file bb.txt does not exist? class WriterTest{ public static void main(String[] args) throws IOException{ Writer w=new BufferedWriter(new FileWriter(“bb.txt”)); // Line1 w.write(1); // Line2 w.close(); } }
- Compiler error
- FileNotFoundException thrown at line 1
- IOException thrown at line 2
- None of these
Which of the following statements are true about the default implementation of the public int hashCode() method of the Object class?
- The Object class does not provide any implementation for the hashCode method; every class must override it
- As far as it may be practically possible, the hashCode method defined by the Object class does return distinct integers for distinct objects
- For two object references referring to the same object, the hashCode method returns the same integer
- It returns a fixed number that internally represents the Object class for the JVM
- Only choice D is correct
whether the casting of objects can be done in java?
- True
- False
Read the code below. Will be the result of attempting to compile and run the code below. public class AQuestion { public void method(Object o){ System.out.println("Object Verion"); } public void method(String s){ System.out.println("String Version"); } public static void main(String args[]){ AQuestion question = new AQuestion(); question.method(null); } }
- The code does not compile
- The code compiles cleanly and shows “Object Version
- The code compiles cleanly and shows “String Version”
- The code throws an Exception at Runtime
Nohup command?
- kill the process
- To run the process even you shutdown the terminal
- display your terminal
- help command
cp command ?
- copies a file
- delete a file
- rename a file
- move a file
Grep Command ?
- compares two directories
- compares the two files
- To search one or more files to match an expression
- To make links to existing files
uniq command removes duplicate adjacent lines from sorted file?
- True
- False
awk command?
- to change ownership of a file or directory
- used to schedule jobs
- stream line editor
- scripting language builtin on all unix systems