Tag: technology

Questions Related to technology

  1. itemMap.remove("orange"); itemMap.put("orange", new Item("Orange") );

  2. ((Item)itemMap.get(“orange”)).name = “Orange”;

  3. itemMap.put("orange", new Item("Orange") );

  4. None of above


Correct Option: B
  1. code attribute cannot be changed as Item class doesn’t have setter method for it.

  2. for (int i = 0; i < itemList.size(); i++) { if(itemList.get(i) != null) { ((Item)itemList.get(i)).code = 50+i; } }

  3. int i = 0; Item im = null; while (i < itemList.size()) { im = (Item)itemList.get(i); if(im != null) { im.code = 50+i; } i++; }

  4. int i = 0; Item im = null; Iterator itr = itemList.iterator(); while (itr.hasNext()) { im =(Item) itr.next(); im.code = 50+i; i++; }


Correct Option: D
  1. Function call:- changeName(im); Function implementation :- { im.name = "Done"; return null; }

  2. Function call:- changeName(im); Function implementation :- { im = new Item("Done"); return null; }

  3. Function call :- im = changeName(im); function implementation :- { Item otherObject = new Item("Done"); return otherObject; }

  4. All of the above


Correct Option: B
  1. im.name = "Done";

  2. Item otherObject = new Item(“Done”); itemList.set(49, otherObject);

  3. ((Item)itemList.get(49)).name = “Done”;

  4. None of above is correct as they are not changing 50th element.


Correct Option: A
  1. SORT FIELDS=COPY OUTREC FIELDS=(1:1,24,25,6,ZD,MUL,+0.97,TO=ZD,LENGTH=6,31:31,185)

  2. SORT FIELDS=COPY OUTREC FIELDS=(1:1,24,25,6,ZD,MUL,+97,DIV,+100,TO=ZD,LENGTH=6,31:31,185)

  3. SORT FIELDS=COPY OUTREC FIELDS=(1:1,24,25,6,ZD,DIV,+100,MUL,+97,TO=ZD,LENGTH=6,31:31,185)

  4. All of the above


Correct Option: B,C
  1. SORT FIELDS=(1,3,CH,A) SUM FIELDS=NONE OUTFILE FNAME = F2

  2. SORT FIELDS=(1,3,CH,A) SUM FIELDS=NONE,XSUM

  3. SORT FIELDS=(1,3,CH,A) SUM FIELDS=NONE COPY = F2

  4. None of the above


Correct Option: B