John Mercier

java programming and scjp

  • Blog
  • Projects

javaranch scjp roundup

Posted on May 11, 2010 by John J Mercier

Filed under Programming | 0 Comments

This post is a roundup of all the interesting posts I have found on javaranch along with my comments. Expect to see more of these as I continue to study for SCJP.

Magic! Magic! The way this works should be obvious. When you start your program with * as a command line argument it will get a list of filenames.

Master exam question. A good question about binarySearch in the Arrays class. You have to understand how an insertion point is returned if the Object is not in the array. Insertion point (-(insertion point) - 1) "The insertion point is defined as the point at which the key would be inserted into the array: the index of the first element greater than the key, or a.length if all elements in the array are less than the specified key. Note that this guarantees that the return value will be >= 0 if and only if the key is found."

serialization. Well it's not the serialization part that is important. The second question in the post talks about the JavaBeans naming convention. For SCJP getVariable, setVariable, addListener, removeListener, and isTrue are valid names.

Method Local Inner classes. It is true that method variables need to be marked final when they are used in method local classes.

http://www.coderanch.com/t/493547/java-programmer-SCJP/certification/Local-variables-type-mismatch-int

The problem here is compile-time constants. When an int is less than or equal to 127 and declared as such, final int i = 127, it is a compile-time constant. It is also able to be assigned to a byte without a cast because the compiler knows it is small enough. This also works with short.

pattern matching. In regex there is a key difference between the patterns "a*" and "aa*" The first looks for zero or more "a" at each index, and the second looks for an "a" followed by zero or more "a".

Share |

« Favorite Posts for... | Main | SCJP Master Exam... »


Comments:

Post a Comment:
  • HTML Syntax: Allowed
  • General (12)
  • Projects (3)
  • Programming (14)

Search

Tag Cloud

activism addthis.com data_structure downloading facebook google google-buzz introduction java javablackbelt jdbc johnmercier.com jsp linux model-1 netbeans nvidia objectivism official-english programming projects pti roller scjp server sql theme uncertainty velocity welfare-state

Friends

  • Ed
  • Shane

Links

  • Glazed Lists
  • JGoodies
  • Java Specialists
  • Swing 2.0
  • Swing Generics
  • ideone
  • pircbot

Feeds

  • All
  • /General
  • /Projects
  • /Programming
  • Comments

Referrers

  • direct (200)
  • www.playdota.com/for (39)
  • baccaratforums.com/g (38)
  • www.mycraft.com/ueba (37)
  • www.cooksillustrated (36)
  • znakomstvaca.info/si (10)
  • znakomonly.info/site (10)
  • microscopiclove.info (5)
  • znakomstvaca.info/si (5)
  • microscopiclove.info (5)
  • microscopiclove.info (5)
  • znakomstvaca.info/si (5)
  • microscopiclove.info (5)
  • microscopiclove.info (5)
  • microscopiclove.info (5)
  • znakomstvaca.info/si (5)
  • microscopiclove.info (5)
  • microscopiclove.info (5)
  • microscopiclove.info (5)
  • microscopiclove.info (5)
  • znakomstvaca.info/si (5)
  • microscopiclove.info (5)
  • microscopiclove.info (5)
  • microscopiclove.info (5)
  • microscopiclove.info (5)
  • microscopiclove.info (5)
  • microscopiclove.info (5)
  • znakomstvaca.info/si (5)
  • microscopiclove.info (5)
  • microscopiclove.info (5)

Navigation

  • John Mercier
  • Weblog
  • Login

©2010 John J Mercier.

Designed by Free CSS Templates. Template by E. Strokin. Powered by Roller Weblogger 4.0.1.