• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Test taking Strategy

 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Object t = new Integer(107);
int k = (Integer) t.intValue()/9;
System.out.println(k);

One (ok,atleast Iam the one) thinks that the question might be from Wrapper classes.so the obj reference with Integer runtime Object can be converted to wrapper type and invoking intValue is Legal.

But,actually the question test Operators Objective.Compiler will complain that the method intValue() is not available in Object. "." Operator Executes first than the Cast Operator causing compiler Error.This is because the . operator has more precedence than the cast operator,so have to write it

int k = ((Integer) t).intValue()/9;

Whizlabs,JQPlus Test Interfaces provides Review Button which gives Objective of a Question.If we know the Objective,We can dodge Questions like these.What about the Real Exam,is it with same Testing Interface like Whizlabs and Enthuware?
[ January 06, 2007: Message edited by: ramya sri ]
 
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The real qestion will not tell you the objective of the questions.
 
reply
    Bookmark Topic Watch Topic
  • New Topic