programming languages Online Quiz - 275
Description: programming languages Online Quiz - 275 | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: programming languages |
Will a C compiler always compile C++ code?
What does the following code snippet do: for(;;) ;
What does the code strcat(an_array, "This"); do?
Evaluate the following: int fn(int v) { if(v==1 || v==0) return 1; if(v%2==0) return fn(v/2)+2; else return fn(v-1)+3; } for fn(7);
Which of the following is not a valid keyword:
What is the correct syntax for inheritance?
Of the numbers 12, 23, 9, and 28, which one would be at the top of a properly implemented maxheap?
What does the line containing "break;" do in the following code? void afunction() { if(1) { break; a_function(); cout<
If you push 1, 3, and 5 - in that order - onto a stack, which number is popped out first?
Which of the following data structures is on average the fastest for retrieving data:
Which is not valid in C?
Which of the following is not a valid declaration for main()?
Evaulate the following: 22%5
Evaluate the following as true or false: !(1 &&0 || !1)
Which command properly allocates memory?
Would you rather wait for the results of a quicksort, a linear search, or a bubble sort on a 200000 element array?
Q: 1 Given: 11. public class Person { 12. private String name, comment; 13. private int age; 14. public Person(String n, int a, String c) { 15. name = n; age = a; comment = c; 16. } 17. public boolean equals(Object o) { 18. if (! (o instanceof Person)) return false; 19, Person p = (Person)o; 20. return age == p.age && name.equals(p.name); 21. } 22. } What is the appropriate definition of the hashCode method in class Person?
2 Given: 34. HashMap props = new HashMap(); 35. props.put("key45", "some value"); 36. props.put("key12", "some other value"); 37. props.put("key39", "yet another value"); 38. Set s = props.keySet(); 39. // insert code here What, inserted at line 39, will sort the keys in the props HashMap?
for (printf("a");printf("b");printf("c")) { break; } What will be the output of the above code snippet?
i=3; Printf("%d%d%d",i++,++i,i); What will be output of the code snippet?