Tag: programming languages
Questions Related to programming languages
-
itemMap.remove("orange"); itemMap.put("orange", new Item("Orange") );
-
((Item)itemMap.get(“orange”)).name = “Orange”;
-
itemMap.put("orange", new Item("Orange") );
-
None of above
-
code attribute cannot be changed as Item class doesn’t have setter method for it.
-
for (int i = 0; i < itemList.size(); i++) { if(itemList.get(i) != null) { ((Item)itemList.get(i)).code = 50+i; } }
-
int i = 0; Item im = null; while (i < itemList.size()) { im = (Item)itemList.get(i); if(im != null) { im.code = 50+i; } i++; }
-
int i = 0; Item im = null; Iterator itr = itemList.iterator(); while (itr.hasNext()) { im =(Item) itr.next(); im.code = 50+i; i++; }
-
Function call:- changeName(im); Function implementation :- { im.name = "Done"; return null; }
-
Function call:- changeName(im); Function implementation :- { im = new Item("Done"); return null; }
-
Function call :- im = changeName(im); function implementation :- { Item otherObject = new Item("Done"); return otherObject; }
-
All of the above
-
im.name = "Done";
-
Item otherObject = new Item(“Done”); itemList.set(49, otherObject);
-
((Item)itemList.get(49)).name = “Done”;
-
None of above is correct as they are not changing 50th element.
-
Item im = new Item(null); im = (Item ) itemList.get(0);
-
Item im = new Item(“Done”); im = (Item ) itemList.get(0);
-
Item im = null; im = (Item ) itemList.get(0);
-
All of the above.
-
a) V_SUM
-
b) CALC_ORD.
-
c) FORWARD_PACK
-
d) GENERATE_SUMMARY.
-
assert
-
interface
-
extend
-
transient
-
x=1 and y=1
-
x=1 and y=2
-
x=2 and y=2
-
x=2 and y=1
-
x=1 and y=1
-
x=2 and y=2
-
x=1 and y=2
-
x=2 and y=1
-
10
-
0
-
Garbage Value
-
Compile time error