A method name myMethod( ) that needs two integer arguments is declared as A) public void myMethod( );
B) public void myMethod(int a, int b);
C) public void myMethod(int a, b);
D) public int myMethod(a, b);

1 Answer

Answer :

B) public void myMethod(int a, int

Related questions

Description : A three dimensional array in C' is declared as int A[x][y][z]. Here, the address of an item at the location A[p][q][r] can be computed as follows (where w is the word length of an integer): (A) &A[0][0][0]+w(y*z*q+z*p+r) (B) &A ... *q+r) (C) &A[0][0][0]+w(x*y*p+z*q+r) (D) &A[0][0][0]+w(x*y*q+z*p+r)

Last Answer : Answer: B

Description : Which of the following characteristics of constructor are true. i) They should be declared in the public section. ii) They are invoked automatically when the objects are created. iii) They do not have return type and void also. ... and v C) Only i, iii, iv and v D) All i, ii, iii, iv and v

Last Answer : D) All i, ii, iii, iv and v

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 : 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 : If a variable is declared final, it must include ...................... value. A) integer B) no C) initial D) float

Last Answer : C) initial

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 : Which of the following is/ are the characteristics of friend function. A) It is not in the scope of the class to which it has been declared as friend. B) It can invoke like a normal function without the help of any object. C) Usually, it has the objects as arguments. D) All of the above.

Last Answer : D) All of the above.

Description : If an integer occupies 4 bytes and a character occupies 1 byte of memory, each element of the following structure would occupy how many bytes ? struct name { int age; char name[30]; }; A) 30 B) 32 C) 34 D) 36

Last Answer : C) 34

Description : The correct way to round off a floating number x to an integer value is (A) y = (int)(x+0.5) (B) y = int(x+0.5) (C) y = (int)x+0.5 (D) y = (int)((int)x+0.5)

Last Answer : (A) y = (int)(x+0.5)

Description : In Java, when we implement an interface method, it must be declared as: (A) Private (B) Protected (C) Public (D) Friend

Last Answer : (C) Public

Description : Define a class student with int id and string name as data members and a method void SetData ( ). Accept and display the data for five students.

Last Answer : import java.io.*; class student { int id; String name; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); void SetData() { try { System.out.println("enter id and name for student"); ... (String are[]) {  student[] arr;  arr = new student[5];  int i;  for(i=0;i

Description : What is the output of the following code? >>> a=(2,3,4) >>> sum(a,3) a) Too many arguments for sum() method b) The method sum() doesn’t exist for tuples c) 12 d) 9

Last Answer : c) 12

Description : Which of the following statements is correct? (A) Every class containing abstract method must not be declared abstract. (B) Abstract class cannot be directly initiated with ‘new’ operator. (C) Abstract class cannot be initiated. (D) Abstract class contains definition of implementation.

Last Answer : Answer: B,C

Description : If the election of the President of India is declared void by the Supreme Court, the acts performed by President Incumbent before the date of such decision of court remain - (1) Valid (2) Invalid (3) Valid Subject to the judicial review (4) Valid Subject to the approval of the parliament

Last Answer : (1) Valid Explanation: If the election of the President of India is declared void by the Supreme Court, the acts performed by President Incumbent before the date of such decision of court remain valid.

Description : In C++, the keyword void was used ……….. A) To specify the return type of function when it is not returning any value. B) To indicate an empty argument list to a function. C) To declare the generic pointers. D) All of the above.

Last Answer : D) All of the above.

Description : Consider the following database table : Create table test( one integer, two integer, primary key(one), unique(two), check(one≥1 and ≤10), check(two≥1 and ≤5) ); How many data records/tuples atmost can this table contain ?  (A) 5 (B) 10 (C) 15 (D) 50

Last Answer : (A) 5 

Description : Why do you write ‘Integer.parseInt(br.readLine())’?

Last Answer : A: The inputs in a java program comes in the form of String objects which are read using the br.readLine() function. Now if we want the input in integer form, we have to convert it into integer using the parseInt() function of the Integer wrapper class.

Description : Which of the following control expressions are valid for an if statement? A) An integer expression B) A Boolean expression C) Either A or B D) Neither A nor B

Last Answer : B) A Boolean expression

Description : Which of the following control expressions are valid for an if statement? A) An integer expression B) A Boolean expression C) Either A or B D) Neither A nor B

Last Answer : B) A Boolean expression

Description : Which of the following control expressions are valid for an if statement? A) an integer expression B) a Boolean expression C) either A or B D) Neither A nor B

Last Answer : B) a Boolean expression

Description : An integer constant in C must have A) At least one digit B) At least one decimal point C) A comma along with digits D) Digits separated by commas

Last Answer : A) At least one digit

Description : If a is an integer variable, a=7/3; will return a value A) 2.5 B) 3 C) 0 D) 2

Last Answer : D) 2

Description : NULL is (A) the same as 0 for integer (B) the same as blank for character (C) the same as 0 for integer and blank for character (D) not a value

Last Answer : (D) not a value

Description : What is the data type of (1)? a) Tuple b) Integer c) List d) Both tuple and integer

Last Answer : b) Integer

Description : Bresenham line drawing algorithm is attractive because it uses (A) Real arithmetic only (B) Integer arithmetic only (C) Floating point arithmetic (D) Real and integer arithmetic

Last Answer : (B) Integer arithmetic only

Description : A computer program selects an integer in the set {k : 1 ≤ k ≤ 10,00,000} at random and prints out the result. This process is repeated 1 million times. What is the probability that the value k = 1 appears in the printout atleast once ? (A) 0.5 (B) 0.704 (C) 0.632121 (D) 0.68

Last Answer : (C) 0.632121

Description : Suppose the function y and a fuzzy integer number around -4 for x are given as y=(x-3)2+2 Around -4={(2,0.3), (3,0.6), (4,1), (5,0.6), (6,0.3)} respectively. Then f(Around - 4) is given by: (A) {(2,0.6), (3,0.3), ... 6), (3,1), (6,0.6), (11,0.3)} (D) {(2,0.6), (3,0.3), (6,0.6), (11,0.3)}

Last Answer : (C) {(2,0.6), (3,1), (6,0.6), (11,0.3)}

Description : If there are n integers to sort, each integer has d digits and each digit is in the set {1,2, ..., k}, radix sort can sort the numbers in: (A) O(d n k) (B) O(d nk) (C) O((d+n)k) (D) O(d(n+k))

Last Answer : (D) O(d(n+k))

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.

Description : Give output for following code: class student { int roll no; char name [14]; } s[6]; void main() { cout<<sizeof(s); }

Last Answer : Considering roll_no(Single variable) the output is: 96 OR Considering roll, no (Two variables) the output is: 108 OR Considering roll no the output is: error – space between roll and no

Description : Rewrite the following code using switch case: int day=Integer.parseInt(jTextField1.getText()); -Technology

Last Answer : int day=Integer.parseInt(jTextField1.getText());switch(day){case 1:case 2:case 3:case 4:case 5:jOptionPane1.showMessageDialog(this, 'Working Day'); break;case 6:case 7:jOptionPane1.showMessageDialog(this, 'Off Day'); break;default:jOptionPane1.showMessageDialog(this, 'Invalid Entry');}

Description : Which of the following arguments are not valid? (a) If Gora gets the job and works hard, then he will be promoted. If Gora gets promotion, then he will be happy. He will not be happy, therefore, either he will not get the job or he ... and (c) (B) (b) and (c) (C) (a), (b) and (c) (D) (a) and (b)

Last Answer : Answer: B Explanation: (a) P: Gora gets the job  Q: Gora works hard  R: Gora gets promotion  S: Gora will be happy The argument can bet written as  (P˄Q)→R  R→S  ¬S ... also be written as: ((P˅Q)˄¬P)→Q where P, and Q are propositions expressed in some formal system.

Description : Which one of the following is correct for overloaded functions in C++? (1) Compiler sets up a separate function for every definition of function. (2) Compiler does not set up a ... functions cannot handle different types of objects. (4) Overloaded functions cannot have same number of arguments.

Last Answer : Answer: 1

Description : In general, the binary search method needs no more than ……………. comparisons. A) [log2n]-1 B) [logn]+1 C) [log2n] D) [log2n]+1

Last Answer : D) [log2n]+1

Description : Consider the following transportation problem: The initial basic feasible solution of the above transportation problem using Vogel's Approximation Method(VAM) is given below: The solution of the ... degenerate solution (B) is optimum solution (C) needs to improve (D) is infeasible solution

Last Answer : (B) is optimum solution

Description : State True or False. i) A satic function can have access to only other static members (functions or variables) declared in the same class. ii) A static member function can be called using the class name (instead of its objects) A) True, True B) True, False C) False, True D) False, False

Last Answer : B) True, False

Description : If a function is friend of a class, which one of the following is wrong ? (A) A function can only be declared a friend by a class itself. (B) Friend functions are not members of a class, they are ... are members of a class. (D) It can have access to all members of the class, even private ones.

Last Answer : (C) Friend functions are members of a class.

Description : How many times does the following code segment execute int x=1, y=10, z=1; do{y--; x++; y-=2; y=z; z++} while (y>1 && z

Last Answer : A) 1

Description : What will be the values of x, m and n after execution of the following statements? Int x, m, n; m=10; n=15; x= ++m + n++; A) x=25, m=10, n=15 B) x=27, m=10, n=15 C) x=26, m=11, n=16 D) x=27, m=11, n=16

Last Answer : C) x=26, m=11, n=16

Description : If m and n are int type variables, what will be the result of the expression m% n when m=5 and n=2 ? A) 0 B) 1 C) 2 D) None of the above

Last Answer : B) 1

Description : Assume that variable x resides at memory location 1234, y at 1111 and p at 2222. Int x=1, y=2, *p; p=&x; y=*p; What will be the value of y after execution of above code? A) 2 B) 1 C) 1234 D) 1111

Last Answer : C) 1234

Description : main() { Int a=3, b=2, c*d*e; d=&a; e=&b; c=*d+*e; } Which one of the given answers is correct? A) a=4, c-6 B) a=3, c=5 C) a=3, c=6 D) a=3, c=8

Last Answer : B) a=3, c=5

Description : int[ ] ={5,6,7,8,9} What is the value of a[3]? A) 9 B) 8 C) 7 D) 6

Last Answer : B) 8

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 : When the following code is executed what will be the value of x and y? int x = 1, y=0; y = x++; (A) 2, 1 (B) 2, 2 (C) 1, 1 (D) 1, 2

Last Answer : (A) 2, 1

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 does the following declaration mean ? int (*ptr) [10]; (A) ptr is an array of pointers of 10 integers. (B) ptr is a pointer to an array of 10 integers. (C) ptr is an array of 10 integers. (D) none of the above.

Last Answer : (B) ptr is a pointer to an array of 10 integers.

Description : What will be the output of the following ‘C’ code ? main ( ) { int x = 128; printf (“\n%d”, 1 + x++); } (A) 128 (B) 129 (C) 130 (D) 131

Last Answer :  (B) 129

Description : What is the value returned by the function f given below when n = 100 ? int f(int n)  { if (n==0) then return n;  else return n + f(n-2);  } (A) 2550 (B) 2556 (C) 5220 (D) 5520

Last Answer : (A) 2550