• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Follow the code?

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm hoping that I can get someone to help boost my confidence here. I'm currently studying for the SCJP and I'm picking up the material in the studyguide extremely well. In fact I'm scoring 50% or better on each practice test in the book. (I take them the following day not 5 minutes after I read it).

While those arent stellar numbers the majority of my incorrect answers are because I'm failing a lot of times to see VERY small details in the code. I've been programming for 15 years in various languages and while the material is easy, some of these code snippets are INSANE. It's almost unfair how a detail of a code piece can smoke you regardless of the compententcy of the topic area.

Now the book says "watch for this, etc. etc." and they have come out and said the book tries to throw you for a loop (in preparation for the exam.) I'm all for studying but I dont see a way to study for code thats written just to trip you up.

My question is (are you still with me) just how tough ARE these code snippets on the exam? I've seen others on the web that look complicated but easy to follow. Should I give up now? Is there more Hype than fact here? Like I said I've been doing this 15 years and the topics are easy, it's these code blocks that are killing me!

Honest feedback?
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I didn't find the actual exam to be "tricky," but certain details are important. Some mock questions out there are a bit on the extreme side, but if you get through them, the real test should be easy.

Which study guide are you using? Can you give us an example of what you're talking about?
 
Rob Mech
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using the Sun Certified Programmer for Java 5 Study Guide (Sierra & Bates)
Before purchasing it I read just about everywhere that it was "the best" for studying for the test. I'm hoping that it's the best just because it is so tricky.

This one tripped me up. I knew darn well what the problem was once I had already answered it wrong.

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

Glad to hear that you have worked on several languages.
I hope you learned C too. The Big Mother.

Its simply creating int array and assaing it to void type. and using casting so as to convert back to explicit datatype.

int *i1 = (int *)malloc(sizeof(int)*10); // 10 integers
void *p=i1; //assiging it to void pointer
int *i2 = (int *)p; //casting void to explicit type; correct
int *i3 = (int)p; //incorrect.

Compared The Mother The Child(java) is Much simpler to code.
Hope this is clear.
[ April 16, 2007: Message edited by: Srinivasan thoyyeti ]
 
Rob Mech
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I didnt have a problem with WHAT it was doing. I had a problem picking out what was wrong with it. That's the issue I seem to be having.
 
Srinivasan thoyyeti
Ranch Hand
Posts: 558
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rob,

You didn't understood the mother.
Coming to child code..

1. class Dims {
2. public static void main(String[] args) {
3. int[][] a = {{1,2,}, {3,4}};
4. int[] b = (int[]) a[1];
5. Object o1 = a;
6. int[][] a2 = (int[][]) o1;
7. int[] b2 = (int[]) o1;
This is the blunder
We can't convert a two dimentional array object into one dimention array Where as this will work ...
int[] b2 = (int [])((int[][])o1)[0];
// taking out the first 1st 1-Dimensional array

8. System.out.println(b[1]);
9. } }
 
Srinivasan thoyyeti
Ranch Hand
Posts: 558
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rob,

Rob:My question is (are you still with me) just how tough ARE these code snippets on the exam? I've seen others on the web that look complicated but easy to follow. Should I give up now? Is there more Hype than fact here? Like I said I've been doing this 15 years and the topics are easy, it's these [censored] code blocks that are killing me!



I haven't seen that many no of languages as you have.
I know Pascal,C,C++,Cobol,Java.

Of all these languages the one which is easy when compared to others is "JAVA".

Why so
1. Java has less complexity compared to c++, by eliminating the concept of pointers code.
2. Java has versatile API, really rich.
3. Java is plateform independent.
4. I like to say Interface is another big asset of java.

Hence Java code is much programer freindly(radable,understandable,extensible).
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic