1600 PMP mock questions 1400 CAPM mock questions 800 SCJP 6 mock questions 600 OCAJP 7 mock questions 590 OCPJP 7 mock questions 556 SCWCD 5 mock questions 500 OCEJWCD 6 mock questions pdfDownload (java,struts, hibernet etc)

Wrong answers in Mock Test JAVA!!!!!

Java   JSP   ORACLE   Hibernate   Servlet   Struts   Spring   MySQL   Java Script     Post New Topic
Category Java
Asked By : krishna Asked Date : Jun 17 2009
Brief Desc: Wrong answers in Mock Test JAVA!!!!!
Details: I found two questions which have right answers selected by me but result for them was wrong!!!
Explanation for those questions proves that my answers were right.
I have taken screen shot for those questions..if you want to see then I can mail.
Please update them in your database.
Questions were :
1)Which of the following can be used to define constructor for this class given the code :
public class Test{...........}
Options : a)public void Test(){..}
b)public Test(){..}
c)public static Test(){..}
d)public static void Test(){..}

My answer: b
Your answer : a

2)What is the output?
public class Test{
public static void main(String... args)
{
printUs("hello");
}
public static void printUs(String abc,String..args)
{
System.out.println("Var args method");
for(String s: args)
System.out.pintln(s);
}
}

Options:
a)Var args method
hello
b)Var args method
c)Runtime Exception
d)Compile with Error

My answer : b
Your answer a


Replied By: Marco Farrugia Replied Date : Sep 5 2012
Answer: I confirm what is said above and agree with the answers given by krishna. Can someone correct these mistakes?


Replied By: Marco Farrugia Replied Date : Sep 5 2012
Answer: The question below also has an incorrect answer:

public enum Test {
BREAKFAST(7, 30), LUNCH(12, 15), DINNER(19, 45);

private int hh;

private int mm;

Test(int hh, int mm) {
assert (hh >= 0 && hh <= 23) : "Illegal hour.";
assert (mm >= 0 && mm <= 59) : "Illegal mins.";
this.hh = hh;
this.mm = mm;
}

public int getHour() {
return hh;
}

public int getMins() {
return mm;
}

public static void main(String args[]){
Test t = BREAKFAST;
System.out.println(t.getHour() +":"+t.getMins());
}
}
My answer: A
Your answer: B


Add Your Reply :

Your Name:
Answer:

  • SCJP 5.0 Simulator 642+ Questions With Explanations
  • SCJP 6.0 Simulator 664+ Questions With Explanations
  • SCWCD 5.0 Simulator 556+ Questions With Explanations
  • SCWCD 4.0 Simulator 500+ Questions With Explanations
  • OCA 10g Simulator 594+ Questions With Explanations
  • Struts Tutorial Home
  • Spring Tutorial Home
  • Hibernate Tutorial Home
  • JSP Tutorial Home
  • JDBC Tutorial Home
  • Webservices Tutorial Home
  • EJB Fundamentals
  • Java mock test.
  • JSP mock test.
  • ORACLE mock test.
  • Hibernate mock test.
  • Servlet mock test
  • Struts mock test
  • C mock test
  • C++ mock test
  • Aptitude mock test
  • Interview Questions from Experts

    Reviews and Comments


    PMP, CAPM, PMI is a registered certification mark of the Project Management Institute, Inc

    Copyright © www.techfaq360.com 2016


    About US | Contact US | Privacy Policy | Terms and Conditions  | Website disclaimer  | Cancellation and Refund Policy  | Shipping & Delivery Policy