Win a copy of Fixing your Scrum this week in the Agile forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

need website offline tutorials

 
Ranch Hand
Posts: 548
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Does anybody have the jchq.net and similiar website mock exams that can be browsed offline.

Thanks & Regards,
Kumar.
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmm. go to dan's website and try to save all the html files.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks,

Plz look at the below code.


Case 1:
---------------------------------------------
class A {

A(Object o) {System.out.println("o");}

A(String s) {System.out.println("s");}

public static void main(String args[]) {
new A(null);
}


}
------------------------------------

The output is: s...


Case 2:

-----------------------------------------------------
class B {

B (C c) {System.out.println("c...");}

B (Object o) {System.out.println("o...");}

B (String s) {System.out.println("s...");}


public static void main(String args[]) {
new B(null) {};
}


}

class C {}
------------------------------------------------------
The compiler is not happy and displaying the below error messages

B.java:12: reference to B is ambiguous, both method B(C) in B and method B(java.lang.String) in B match
new B(null) {};
^
B.java:12: cannot resolve symbol
symbol : constructor B ()
location: class B
new B(null) {};
^
2 errors



1) Why is the Subclass constructor being called in Case 1?

2) Why is the code in case 2 failing to compile?

Plz explain me. May be I am missing basics here

Thx,
Sreenivas
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For Case 1 :

Remember, by default all the classes are extending Object class. SO String is also a sub class of Object. Compiler will take the most closely matched constructor. and in this case it is String which closely matches.

For Case 2 :

Both C & String are sub classes of Object. Compile can't predict which constructor has to choose. so it displays ambiguos error
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think someone has posted a little off the original topic
 
arch rival
Posts: 2813
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Siva,
As was mentioned you can go to http://www.danchisholm.net and download lots of pages from there. If you like what you see you can also buy them in printed book form.

You can d/load and save my static pages from
http://www.jchq.net/mockexams/exam2.htm (and exam1, and exam3) as well though they are for the previous version of the xam.

Marcus
 
Rr Kumaran
Ranch Hand
Posts: 548
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Marcus ...
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi siva,

check out this website :
www.httrack.com/

This website has a program named HTTrack which mirrors websites to your harddisk. I have mirrored the entire Dan's website for my easy reference through this tool. I guess its an opensource program and its free. You will not need to save all the pages from dan's site, just use this program.
 
I'm gonna teach you a lesson! Start by looking at this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic