Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Any extra-terrestrial scjp tutorials ?

 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have :
1.Exam Cram
2.Java2 Certification Exam Guide
I thought two books for scjp should be enough.
But after I did about 1000 mock questions, I found that I need something more than the two
books give.
For example, the books do not talk about :
int[] i = new int[0];
I thought this was wrong syntax. How can we new "nothing"? i.e.new int[0];
I found out later that it is correct syntax.
Another example:
individual code blocks in class definition.
I thought it was wrong,too. But it is correct.
One more:
A mock question asks you whether an interface
can have constructors ?
How do I know ! I could only guess the answer.
Mock tests seems to search for as many strange stuff (You never use them in real life) as possible to make up the questions, especially
mock exams from Sun Guoqiao's. If the real
scjp exam also have impractical but workable
code for the questions, we might have to buy
another voucher. So, are there any strange scjp
stuff available?
Thanks
 
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Alan Chong:
Mock tests seems to search for as many strange stuff (You never use them in real life) as possible to make up the questions...


Of course they do. It's the concept of "overlearning" or "overtraining." If you can handle reading and understanding the code on the exam, you can be very sure that you'll be able to understand any code used in "real life." You test yourself on the extreme examples so that, when it comes to a real problem, it seems much easier. Perhaps you've seen baseball players weing a bat with a weight on it or runners training by running through a pool of water. You do this so that, when it comes time to really swing the bat or run a race, it seems much easier than when you had trained.
I really can't imagine that buying a third or fourth book would be of much benefit to you. Not that other books aren't great, but most of the material would simply be repeated from the texts you have. It would seem to me to be a waste of money to buy a book for $50 or more only to get a couple juicy tidbits from it that you didn't already have in your other books.
Just keep on taking mock exams and frequent the Ranch. Most of the goofy questions come up here so you'll get plenty of exposure. And if something comes up that trips you up, don't be afraid to consult the JLS. It's a little initimidating at first, but, once you get used to it, it's an invaluable resource. For example, your question about interfaces having constructors could have been resolved by checking the JLS, §9.1.3 Interface Body and Member Declarations.
Corey
 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with Corey, two books are more than enough. I think that from now on you should use the web resources- and there�s plenty of them. In my opnion you�re already on one of the best places...you should check this 3, if you don�t know them already:
  • Marcus Green�s JCHQ - great tutorials and mocks
  • Java Prepare - good tutorials
  • j-Think - great flash animations showing you the way...


  • Francisco
    [ June 10, 2002: Message edited by: Francisco A Guimaraes ]
     
    Ranch Hand
    Posts: 106
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Corey,
    I browsed through the page you have pointed but could not find anything related to contructor.
    i thing that interfaces does not have constructor as we can not instantiate interfaces but only methods and fields as constants.Am I right?
    I am also not comfortable with JLS
     
    Ranch Hand
    Posts: 3244
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    The other best thing you already have is your favorite editor and the compiler. When you get a question or concept that you're not completely sure of write a simple piece of code - just a few lines - to test it.
    Write an interface with a constructor then a short class to implement and use it. Should take about 10 lines of code. This is the best way to test things and to realy get a grasp on them.
    Create a small test class and everytime you have a question or are unclear about something modify it and play with it. Try different things that aren't even mentioned in the books, different syntax, different declarations, etc. Try to predict what'll happen before you compile/run them and then go the JLS and try to figure out why the results were what they were. Like Corey said, the JLS is great, it'll explain just about everything you need to know. If you're unclear about anything then come here and ask and someone will help you out.
     
    Corey McGlone
    Ranch Hand
    Posts: 3271
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Originally posted by swati gupta:
    Corey,
    I browsed through the page you have pointed but could not find anything related to contructor.
    i thing that interfaces does not have constructor as we can not instantiate interfaces but only methods and fields as constants.Am I right?
    I am also not comfortable with JLS


    You're right. An interface can't have a constructor because you can't instantiate an interface (nor a subinterface of an interface). Therefore, there is no need for a constructor in an interface. Notice, though, that an abstract class (which also can not be instantiated) must have a constructor because a subclass of it may be instantiated.
    However, the information is there in the JLS. Let me show you.
    In the section I pointed out, there is a section that describes what an interface can contain:


    InterfaceBody:
       { InterfaceMemberDeclarationsopt }
    InterfaceMemberDeclarations:
       InterfaceMemberDeclaration
       InterfaceMemberDeclarations InterfaceMemberDeclaration
    InterfaceMemberDeclaration:
       ConstantDeclaration
       AbstractMethodDeclaration
       ClassDeclaration
       InterfaceDeclaration
       ;


    Nowhere in there does it say that an Interface can have a constructor. However, if we compare this to the description of what is in a class (from §8.1.5 Class Body and Member Declarations):


    ClassBody:
       { ClassBodyDeclarationsopt }
    ClassBodyDeclarations:
       ClassBodyDeclaration
       ClassBodyDeclarations ClassBodyDeclaration
    ClassBodyDeclaration:
       ClassMemberDeclaration
       InstanceInitializer
       StaticInitializer
       ConstructorDeclaration
    ClassMemberDeclaration:
       FieldDeclaration
       MethodDeclaration
       ClassDeclaration
       InterfaceDeclaration
       ;


    As you can see, you can have a constructor in a class, but not in an interface.
    Don't be discouraged if you're not comfortable with the JLS. It takes some time and some practice to "learn" to read it. There are some people around here (aka Val) that can spew forth the JLS at will, but not all of us are that good at it. Even I spend some time scouring and digesting that thing. (I'll bet Val does sometimes, too.) The best advice I can give you is to consult the JLS whenever you have a question. Take a few minutes to try to find what you're looking for. If you can't find what you're after or, if you think you've found what you're after but you don't understand it well, ask here. We'll be more than happy to help you.
    I can't stress enough how great of a resource the JLS is. It is, after all, the definitive source when it comes to the Java Programming Language. Just in case you don't have it, here is the URL to the table of contents of the JLS:
    http://java.sun.com/docs/books/jls/second_edition/html/jTOC.doc.html
    I hope that helps,
    Corey
     
    Swati Gupta
    Ranch Hand
    Posts: 106
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks a lot Corey and Dave.
    This is really a great site with great people like you all.
    Thanks for the advice Dave. I try to do that if I get some code written but very reluctant to start writing my own. I will try to do more.
    Also i will have to make myself comfortable with JLS.
    [ June 10, 2002: Message edited by: swati gupta ]
     
    Ranch Hand
    Posts: 2120
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I would like to stress the importance of writing many examples to learn how things work.
     
    Alan Chong
    Ranch Hand
    Posts: 106
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I even wrote small code to test whether mock
    questions I did are correct. This is a sure
    way to learn. But there is a small problem with
    this approach. If I have to write code for testing everything I learn for scjp, it might
    take me one year to prepare for scjp exam.
    No doctors become doctors by experimenting with
    living human bodies. They become doctors by
    learning the CORRECT stuff. We also become a
    java programmer by learning the correct stuff.
    The tutorials we learn from should be so correct
    that we never have to write code to verify its
    correctness. The JLS is great and correct.Most
    specifications tend to tells you what are correct, but they don't tend to tell you "what could be wrong". That is no good for preparing
    any exams and that is why people have to write exam books to help other get certified,otherwise
    we could use just the JLS to prepare for scjp.
     
    They worship nothing. They say it's because nothing lasts forever. Like this tiny ad:
    Java file APIs (DOC, XLS, PDF, and many more)
    https://products.aspose.com/total/java
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!