What would happen if "String[]args" is not included as argument in the main method. A) No error
B) Compilation error
C) Program won't run
D) Program exit

1 Answer

Answer :

C) Program won't run

Related questions

Description : Consider the following JAVA program: public class First { public static int CBSE (int x) { if (x < 100) x = CBSE (x +10); return (x - 1); } public static void main (String[] args){ System.out.print(First.CBSE(60)); } } What does this program print? (1) 59 (2) 95 (3) 69 (4) 99

Last Answer : (2) 95 

Description : Is it compulsory to write String args[] when running a program in BlueJ?

Last Answer : A: No it is not compulsory when we are running it in BlueJ. But normally (in all other cases) it is always better to have it, as the JVM looks for the main method with a String array as a parameter.

Description : When an array is passed as parameter to a function, which of the following statements is correct ? (A) The function can change values in the original array. (B) In C, parameters are passed by value, ... . (D) Results in a run time error when the function tries to access the elements in the array.

Last Answer : (A) The function can change values in the original array.

Description : What is the output of the following program ? (Assume that the appropriate pre-processor directives are included and there is no syntax error) main() { char S[ ] = "ABCDEFGH"; printf ("%C",* (& ... Base address of S is 1000 */ } (A) ABCDEFGH1000 (B) CDEFGH1000 (C) DDEFGHH1000 (D) DEFGH1000

Last Answer : (D) DEFGH1000

Description : When an array is passed as a parameter to a function which of the following statements is correct? (A) The function can change values in the original array. (B) The function cannot change values in the original array. (C) Results in compilation error. (D) Results in runtime error.

Last Answer : (A) The function can change values in the original array.

Description : Which of the following has compilation error in C ? (A) int n = 32; (B) char ch = 65; (C) float f= (float) 3.2; (D) none of the above

Last Answer : D

Description : What will happen if a predecessor description is generated that is satisfied by the initial state of the planning problem? a) Success b) Error c) Compilation d) Termination

Last Answer : d) Termination

Description : function is used to transfer the control to end of a program which uses one argument( ) and takes value is zero for_ __ termination and non-zero for _termination: a. _ Exit( ) normal, abnormal b. Break, normal, abnormal Botha & b None of these

Last Answer : a. _ Exit( ) normal, abnormal

Description : What will be the output of the following segment of the program? main( ) { char *s = “hello world”; int i = 7; printf(“%, *s”, i, s); } (A) Syntax error (B) hello w (C) hello (D) o world

Last Answer : Answer: Marks given to all

Description : Consider a program that consists of 8 pages (from 0 to 7) and we have 4 page frames in the physical memory for the pages. The page reference string is :  1 2 3 2 5 6 3 4 6 3 7 3 1 5 3 6 3 4 2 4 3 4 5 ... to fill available page frames with pages): (A) 9 and 6 (B) 10 and 7 (C) 9 and 7 (D) 10 and 6

Last Answer : (B) 10 and 7

Description : The Servlet Response interface enables a servlet to formulate a response for a client using the method ............... (A) void log(Exception e, String s) (B) void destroy() (C) int getServerPort() (D) void setContextType(String Type)

Last Answer : (D) void setContextType(String Type)

Description : In Data mining, .............. is a method of incremental conceptual clustering. (A) STRING (B) COBWEB (C) CORBA (D) OLAD

Last Answer : (B) COBWEB

Description : What error will be generated if a space is given between the logical AND operator (&&)? Will it be a compile-time or a run-time error?

Last Answer : Example: if(5>2 & & 6

Description : Which of the following do not represent legal flow control statements? A) break; B) return; C) exit(); D) continue outer;

Last Answer : C) exit();

Description : Which of the following do not represent legal flow control statements? A) break; B) return; C) exit(); D) continue outer;

Last Answer : C) exit();

Description : Which of the following are the states of a five state process model? i) Running ii) Ready iii) New iv) Exit v) Destroy A) i, ii, iii and v only B) i, ii, iv and v only C) i, ii, iii, and iv only D) All i, ii, iii, iv and v

Last Answer : C) i, ii, iii, and iv only

Description : Are comments included during the compilation stage and placed in the EXE file as well?

Last Answer : No, comments that were encountered by the compiler are disregarded. Comments are mostly for the guidance of the programmer only and do not have any other significant use in the program functionality.

Description : Which of the following information not included in memory table? A) The allocation of main memory to process. B) The allocation of secondary memory to process C) Any information needed to manage virtual memory D) Any information about the existence of file

Last Answer : D) Any information about the existence of file

Description : Trace the error: void main( ) { int *b, &a; *b = 20 printf(“%d, %d”, a, *b) } (A) No error (B) Logical error (C) Syntax error (D) Semantic error

Last Answer : (C) Syntax error

Description : The compiled java program can run on any ..................... plateform having Java Virtual Machine (JVM) installed on it. A) program B) java C) hardware D) non java

Last Answer : C) hardware

Description : Which one of the following is correct? (A) Java applets cannot be written in any programming language (B) An applet is not a small program. (C) An applet can be run on its own. (D) Applets are embedded in another applications. 

Last Answer : (D) Applets are embedded in another applications.

Description : Suppose that the number of instructions executed between page faults is directly proportional to the number of page frames allocated to a program. If the available memory is doubled, the mean interval between page faults is also ... memory were available? (A) 60 sec (B) 30 sec (C) 45 sec (D) 10 sec

Last Answer : Answer: C Explanation: T = Ninstr x 1µs + 15,000 x 2,000 µs = 60s Ninstr x 1µs = 60,000,000 µs - 30,000,000 µs = 30,000,000 µs Ninstr = 30,000,000 The number of instruction ... doesn't mean that the program runs twice as fast as on the first system. Here, the performance increase is of 25%.

Description : In what way is a file more flexible than a String?

Last Answer : Ans: A file is stored permanently in a storage device.It is easy to access a file whenever required. On the other hand, a string is stored temporarily in RAM, and the contents of a string will be erased automatically when the power is switched off or when the program execution is terminated.

Description : Why is the ‘S’ of String capital?

Last Answer : A: Since String is a class.

Description : Which command is used to concatenate all files beginning with the string 'emp' and followed by a non-numeric characters? A. cat emp[!0-9] B. more [emp][!0-9] C. cat emp[x-z]

Last Answer : A. cat emp[!0-9]

Description : Which command is used to change protection mode of files starting with the string emp and ending with 1,2, or 3? A. chmod u+x emp[l-3] B. chmod 777 emp* C. chmod u+r ??? emp D. chmod 222 emp? E. None of the above

Last Answer : A. chmod u+x emp[l-3]

Description : Which command is used to copy all files having the string chap and any two characters after that to the progs directory? A. cp chap?? progs B. cp chap* progs C. cp chap[12] /progs/*.*

Last Answer : A. cp chap?? progs

Description : In java, string is a ............. A) primitive data type B) abstract data type C) combination of boolean D) None of the above

Last Answer : B) abstract data type

Description : Which of the following methods belong to the string class? A) length( ) B) compare To ( ) C) equals ( ) D) All of them

Last Answer : D) All of them

Description : Which of the following methods belong to the string class? A) length( ) B) compare To ( ) C) equals ( ) D) All of them

Last Answer : D) All of them

Description : The class string belongs to ................... package. A) java.awt B) java.lang C) java.applet D) java.string

Last Answer : B) java.lang

Description : ………… function writes a string of text to a window. A) cputs () B) put () C) gets () D) tputs ()

Last Answer : A) cputs ()

Description : The ..................... is essentially used to search for patterns in target string. A) Like Predicate B) Null Predicate C) In Predicate D) Out Predicate

Last Answer : A) Like Predicate

Description : Data items grouped together for storage purposes are called a A) record B) title C) list D) string

Last Answer : A) record

Description : To remove string “hello” from list1, we use which command ? a) list1.remove(“hello”) b) list1.remove(hello) c) list1.removeAll(“hello”) d) list1.removeOne(“hello”)

Last Answer : d) list1.removeOne(“hello”)

Description : The output of executing string.ascii_letters can also be achieved by: a) string.ascii_lowercase_string.digits b) string.ascii_lowercase+string.ascii_upercase c) string.letters d) string.lowercase_string.upercase

Last Answer : d) string.lowercase_string.upercase

Description : Which is the correct statement(s) for Non Recursive predictive parser? S1: First(α) = {t | α => * t β for some string β } => *tβ S2: Follow(X) = { a | S => * αXa β for some strings ... and S2 is correct. (C) S1 is correct and S2 is incorrect. (D) Both statements S1 and S2 are correct. 

Last Answer : (D) Both statements S1 and S2 are correct.

Description : Which of the following derivations does a top-down parser use while parsing an input string ? The input is scanned from left to right. (A) Leftmost derivation (B) Leftmost derivation traced out in reverse (C) Rightmost derivation traced out in reverse (D) Rightmost derivation

Last Answer : (A) Leftmost derivation

Description : The control string in C++ consists of three important classifications of characters (A) Escape sequence characters, Format specifiers and Whitespace characters (B) Special characters, White-space ... and Non-white space characters (D) Special characters, White-space characters and Format specifiers

Last Answer : (C) Format specifiers, White-space characters and Non-white space characters

Description : The process of dividing an analog signal into a string of discrete outputs, each of constant amplitude, is called: (A) Strobing (B) Amplification (C) Conditioning (D) Quantization

Last Answer : (D) Quantization

Description : What does the following command do? grep −vn abc x (A) It will print all of the lines in the file x that match the search string abc (B) It will print all of the lines in file x that do not ... (D) It will print the specific line numbers of the file x in which there is a match for string abc

Last Answer : (A) It will print all of the lines in the file x that match the search string “abc”

Description : A LRU page replacement is used with four page frames and eight pages. How many page faults will occur with the reference string 0172327103 if the four frames are initially empty? (A) 6 (B) 7 (C) 5 (D) 8

Last Answer : (B) 7

Description : Consider the reference string 0 1 2 3 0 1 4 0 1 2 3 4 If FIFO page replacement algorithm is used, then the number of page faults with three page frames and four page frames are .......... and ........... respectively. (A) 10, 9 (B) 9, 9 (C) 10, 10 (D) 9, 10

Last Answer : (D) 9, 10

Description : Which of the following is FALSE ? (A) The grammar S ⟶ aSb|bSa|SS|∈, where S is the only non-terminal symbol and ∈ is the null string, is ambiguous. (B) SLR is powerful than LALR. (C) An LL(1) parser is a top-down parser. (D) YACC tool is an LALR(1) parser generator.

Last Answer : (B) SLR is powerful than LALR.

Description : The number of strings of length 4 that are generated by the regular expression (0|∈) 1+2* (3|∈), where | is an alternation character, {+, *} are quantification characters, and ∈ is the null string, is: (A) 08 (B) 10 (C) 11 (D) 12

Last Answer : (D) 12

Description : In how many ways can the string A ∩ B - A ∩ B - A be fully parenthesized to yield an infix expression? (A) 15 (B) 14 (C) 13 (D) 12

Last Answer : (B) 14

Description : Which of the following is not an inherent application of stack? (A) Implementation of Stack (B) Evaluation of a postfix expression (C) Job Scheduling (D) Reverse a string

Last Answer : (C) Job Scheduling

Description : In a relational database model, NULL values can be used for all but which one of the following? (A) To allow duplicate tuples in the table by filling the primary key column(s) with NULL. (B) To ... D) To fill a column in a tuple when that column does not really exist for that particular tuple.

Last Answer : (A) To allow duplicate tuples in the table by filling the primary key column(s) with NULL.