<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Is TDD dead yet? on Medium]]></title>
        <description><![CDATA[Stories by Is TDD dead yet? on Medium]]></description>
        <link>https://medium.com/@IsTDDDeadYet?source=rss-3597908b638d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*k9eY-H6zhAhSLme3.png</url>
            <title>Stories by Is TDD dead yet? on Medium</title>
            <link>https://medium.com/@IsTDDDeadYet?source=rss-3597908b638d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 20:19:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@IsTDDDeadYet/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Road to Certification #2]]></title>
            <link>https://medium.com/@IsTDDDeadYet/road-to-certification-2-9f0ce09e5aca?source=rss-3597908b638d------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f0ce09e5aca</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[oracle-certification]]></category>
            <category><![CDATA[certification]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Is TDD dead yet?]]></dc:creator>
            <pubDate>Thu, 27 Jun 2013 00:00:00 GMT</pubDate>
            <atom:updated>2017-11-30T00:08:20.755Z</atom:updated>
            <content:encoded><![CDATA[<ul><li><strong>public</strong>: a method or a variable can be accessed anyway;</li><li><strong>private</strong>: a method or a variable is visible only inside the class. If a class method is private, a subclass can have a method with the same signature but it’s not an <em>override</em>, it’s just a normal method;</li></ul><blockquote><em>you should always declare your attributes private and use getters and setters. Read more about </em><a href="http://en.wikipedia.org/wiki/Encapsulation_%28object-oriented_programming%29"><em>encapsulation</em></a><em>.</em></blockquote><ul><li><strong>protected</strong>: a method or a variable has package level visibility and subclass visibility even if they are in different packages;</li><li><strong>default</strong>: a method or a variable has package level visibility. It’s not a keyword;</li><li><strong>final</strong>: used on methods implies you can’t override them in the subclasses. Used on variables remove the ability to reassign them to other values. Be aware that in case a variables point to an object, you just can assign to it a new object but you can modify the state of the object;</li><li><strong>abstract</strong>: used on methods implies the method is not implemented. When a method is abstract the class <em>must</em> be abstract or you’ll have a compilation error;</li><li><strong>static</strong>: used on methods or variables indicates it’s a class level member. Since you cannot override class level members, you cannot use static with abstract. A static variable can be used in the subclass without the need of using the class name like StaticClass.x;</li><li><strong>synchronized</strong>: used on a methods, allows only one thread to access it at the time. You can use it also with code blocks.</li><li><strong>strictfp</strong>: we saw that on classes, we can also use it on methods;</li><li><strong>transient</strong>: you can use it on class attributes to specify that they must not be considered during serialization (more on this in future posts);</li></ul><p>void myMethod(int...x) {} has as parameter a var-arg. You can pass it an arbitrary number of arguments of a specific type. If you have more parameters, var-args must be the last of them in the signature of the method. You can pass both primitives and objects. The following code is valid:</p><pre>public void foo(int i, String... strings) {<br>	String[] someStrings = strings;<br>}</pre><h3>Constructors</h3><p>They do not have a return type, they can accept arguments, var-args included. They cannot be <em>abstract</em>, <em>final</em> or <em>static</em> because they must be implemented (you even have a default constructor if not explicitly declared), cannot be overridden and it’s bound to a class instance.</p><h3>Primitives</h3><p>We have <strong>byte</strong>(1 byte), <strong>short</strong>(2 bytes), <strong>int</strong>(4 bytes), <strong>long</strong>(8 bytes), <strong>float</strong>(4 bytes), <strong>double</strong>(8 bytes). They are <strong>SIGNED</strong> ,so be aware of the range of values they can accept, you can read more about it <a href="http://www.cafeaulait.org/course/week2/02.html">here</a>.</p><p>We also have <strong>boolean</strong> primitives that can accept only <em>true</em> and <em>false</em>. In Java <em>false</em> is different from <em>0</em>, you always have to check for boolean values in conditional controls (like if..else or while).</p><p>And then we have <strong>char</strong>, 16-bit unicode characters. They can be used as integers with values from 0 to 65535.</p><h3>Instance Variables</h3><p>They can have all four access modifiers, can be <em>final</em> and <em>transient</em>. They have a default value. They cannot be <em>abstract</em>, <em>synchronized</em>, <em>strictfp</em>, <em>native</em> and <em>static</em>.</p><h3>Local Variables</h3><p>They are in the stack and can be final and you must initialize them when you want to use them. If you don’t do it you’ll get a compile-error.</p><h3>Array declaration</h3><p>They are objects and are in the heap. They can contain both objects and primitives and if you don’t initialize the elements they get a default value. You can declare them like this:</p><pre>int[] x;<br>itn x[];<br>int[][] x; // multidimensional array<br>int[] x = new int[5]; // dimension goes<br>//in the constructor, not in the declaration<br><br>/**<br>* The following is legal, array is an object<br>*/<br>public Object returnArray() { int[] x; return x; }</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f0ce09e5aca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Road to Certification #1]]></title>
            <link>https://medium.com/@IsTDDDeadYet/road-to-certification-1-76af799d872f?source=rss-3597908b638d------2</link>
            <guid isPermaLink="false">https://medium.com/p/76af799d872f</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[certification]]></category>
            <dc:creator><![CDATA[Is TDD dead yet?]]></dc:creator>
            <pubDate>Wed, 26 Jun 2013 00:00:00 GMT</pubDate>
            <atom:updated>2017-11-29T23:59:18.108Z</atom:updated>
            <content:encoded><![CDATA[<p>You cannot use language keywords as identifiers. You’ll have a compiler-time error.</p><p>An identifier is legal when the compiler does not complain about it. So this means that respecting the Java naming<br> convention is <strong>optional</strong>.</p><blockquote><em>you need to be careful when you read the question because if it does not ask specifically about naming conventions, just focus about what is legal.</em></blockquote><p>An identifier is composed by <em>Java Letters</em> and <em>Java Digits</em> and it must start with a Java Letter. It is <strong>case-sensitive</strong>. A Java Letter is in the range [A-Za-z_$] and a Java Digit is in the range [0-9].</p><blockquote><em>The </em><a href="http://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.8"><em>Java Language Specification</em></a><em> states that: </em>Letters and digits may be drawn from the entire Unicode character set, which supports most writing scripts in use in the world today, including the large sets for Chinese, Japanese, and Korean. This allows programmers to use identifiers in their programs that are written in their native languages.</blockquote><h3>Java Code Conventions</h3><p>You really need to understand what <a href="http://en.wikipedia.org/wiki/CamelCase">CamelCase</a> is to get this paragraph :)</p><ul><li><em>Classes</em> always start with a capital letter and if you have a class composed by two or more words they follow the CamelCase rules, like MyCoolClass.</li><li><em>Interfaces</em> are like classes but you need to use an adjective like Comparable.</li><li><em>Methods</em> use camelCase and use the couple verb-noun, like getSomething().</li><li><em>Constants</em> (variables marked static and final) use capital letters and the _ is used to separate words, like MAX_SIZE.</li></ul><h3>JavaBeans Standards</h3><p>JavaBeans are classes with properties. You can read and write these properties using the so-called <em>getters</em> and <em>setters</em> methods.</p><p>A getter follows the get<em>Property</em> naming convention and the signature is public &lt;PropertyReturnType&gt; getProperty().</p><p>A setter follows the set<em>Property</em> naming convention and the signature is public void setProperty( &lt;PropertyReturnType&gt; property)</p><p>A listener has add and remove methods. The naming conventions are add<em>EventName</em>Listener and remove<em>EventName</em>Listener and the respective signatures are: public void addEventNameListener(&lt;EventNameListener&gt; eventListener) and public void removeEventNameListener(&lt;EventNameListener&gt; eventListener) so remember that you have to pass the listener as argument of the method in both cases.</p><h3>Source File Composition</h3><ul><li>in a source file only one class can be declared <em>public</em> and the class name equals to the file name</li><li>we have a <strong>package</strong>, then the <strong>import</strong>s , then the class. <em>package</em> and <em>import</em>s are optional</li><li><strong>import</strong>s are per file, not per class</li><li>if you don’t have a public class then you can name the source file as you like</li></ul><h3>Class Access Modifier</h3><p>A class can have a <em>default</em> access or a <em>public</em> access:<br>- <strong>default access</strong>: we have a package level visibility. The class can be seen only from inside the package.<br>-<strong> public access</strong>: we can see the class from every package. Remember though that public doesn’t mean that you don’t need to import the class first.</p><p>You can avoid importing a class when it is in the same package of the class where you want to use it.<br>Terrible phrasing, I’m sorry. Here’s an example:</p><pre>package com.oscjp.defaultclassmodifier.externalaccess;<br>public class MyExternalClass {}<br><br>package com.oscjp.defaultclassmodifier.defaultaccess;<br>public class SomeOtherClass {<br>	/**<br>	 * No compiler error!<br>	 */<br>	MyDefaultClass myDefaultClass;<br>}</pre><h3>Class (non-access) modifier</h3><p>You can use the following modifiers in combination with access modifiers:<br>- <strong>strictftp</strong> can be used on classes, interfaces or methods. You can read more about it <a href="http://en.wikipedia.org/wiki/Strictfp">here</a>;<br>- <strong>final</strong> can be used on classes, methods or variables. A final class cannot be extended, a final method cannot be overridden, a final variable cannot be reassigned;<br>- <strong>abstract</strong> can be used on classes or methods. An abstract class cannot be instantiated (compilation error) and an abstract method is not implemented and <em>only abstract classes can have abstract methods (compilation error otherwise</em></p><pre>void someMethod() {/* implementation */}<br>...<br>abstract void someMethod(); /* notice the &quot;;&quot; at the end*/</pre><h3>Declaring an interface</h3><p>An interface is a contract a class must obey. The class must <strong>implement</strong> it. Here’s the rules for an interface:<br>- methods defined in an interface are implicity <em>public</em> and <em>abstract</em>. You cannot use <em>static</em> on a method because a static method is not inherited so it won’t make sense;<br>- all variables are implicity <em>public</em>, <em>static</em> and <em>final</em> so remember that they need to be initialized, are not inherited by classes implementing that interface and cannot be reassigned;<br>- you cannot declare methods <em>final</em>, <em>strictftp</em> or <em>native</em><br>- an interfaces can <strong>extends</strong> one or more interfaces</p><pre>interface Bounceable {<br>	void something();<br>}<br>interface Breakable {<br>	void something();<br>}<br>/**<br> * notice that it doesn&#39;t matter they have the same<br> * method name because the class will just have one<br> * implemented method<br> */<br>interface Someable extends Bounceable, Breakable {}</pre><p>Also notice that public abstract interface Bounceable equals to public interface Bounceable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76af799d872f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>