<?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[Learn Java for Android Development - Medium]]></title>
        <description><![CDATA[Introduction to Java - Medium]]></description>
        <link>https://medium.com/learn-java-for-android-development?source=rss----59f605d28ff1---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Learn Java for Android Development - Medium</title>
            <link>https://medium.com/learn-java-for-android-development?source=rss----59f605d28ff1---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 04:07:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/learn-java-for-android-development" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[What is JVM , JDK, JRE, JIT]]></title>
            <link>https://medium.com/learn-java-for-android-development/what-is-jvm-jdk-jre-jit-9a33815e75ca?source=rss----59f605d28ff1---4</link>
            <guid isPermaLink="false">https://medium.com/p/9a33815e75ca</guid>
            <dc:creator><![CDATA[Krishna]]></dc:creator>
            <pubDate>Thu, 02 Oct 2014 03:44:27 GMT</pubDate>
            <atom:updated>2014-10-02T03:44:26.903Z</atom:updated>
            <content:encoded><![CDATA[<p>JDK, JRE and JVM are core concepts of Java programming language. Although they all look similar and as a programmer we don’t care about these concepts a lot, but they are different and meant for specific purposes. It’s one of the common java interview question and this article will explain each one of these and what is the difference between them.</p><h4>Java Development Kit (JDK)</h4><p>Java Development Kit is the core component of Java Environment and provides all the tools, executables and binaries required to compile, debug and execute a Java Program. JDK is a platform specific software and thats why we have separate installers for Windows, Mac and Unix systems. We can say that JDK is superset of JRE since it contains JRE with Java compiler, debugger and core classes. Current version of JDK is 1.8 also known as Java8.</p><h4>Java Virtual Machine(JVM)</h4><p>JVM is the heart of java programming language. When we run a program, JVM is responsible to converting Byte code to the machine specific code. JVM is also platform dependent and provides core java functions like memory management, garbage collection, security etc. JVM is customisable and we can use java options to customise it, for example allocating minimum and maximum memory to JVM. JVM is called <em>virtual </em>because it provides a interface that does not depend on the underlying operating system and machine hardware. This independence from hardware and operating system is what makes java program write-once run-anywhere.</p><h4>Java Runtime Environment (JRE)</h4><p>JRE is the implementation of JVM, it provides platform to execute java programs. JRE consists of JVM and java binaries and other classes to execute any program successfully. JRE doesn’t contain any development tools like java compiler, debugger etc. If you want to execute any java program, you should have JRE installed but we don’t need JDK for running any java program.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a33815e75ca" width="1" height="1" alt=""><hr><p><a href="https://medium.com/learn-java-for-android-development/what-is-jvm-jdk-jre-jit-9a33815e75ca">What is JVM , JDK, JRE, JIT</a> was originally published in <a href="https://medium.com/learn-java-for-android-development">Learn Java for Android Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why java is secure compared with other programming languages?]]></title>
            <link>https://medium.com/learn-java-for-android-development/why-java-is-secure-compared-with-other-programming-languages-e0a2efbed3e5?source=rss----59f605d28ff1---4</link>
            <guid isPermaLink="false">https://medium.com/p/e0a2efbed3e5</guid>
            <dc:creator><![CDATA[Krishna]]></dc:creator>
            <pubDate>Thu, 02 Oct 2014 03:18:25 GMT</pubDate>
            <atom:updated>2014-10-02T03:18:25.237Z</atom:updated>
            <content:encoded><![CDATA[<p>There are many reasons why Java is a <em>safe </em>language, and it’s definitely safer than some languages, but I think it’s a stretch to say that it’s safer than <em>all other </em>languages.</p><p>Java has a variety of safety features in place:</p><ol><li>Automatic null-checking of references, bounds-checking of arrays, verification of casts, etc. to prevent the program from making type errors. Compare this to C or C++, where these same errors (with a few exceptions) cause undefined behaviour.</li><li>Verification of bytecode prior to execution. This makes it impossible for the program to jump to an undefined instruction, or to try to perform an operation on a nonexistent object, or to make a type error at the instruction level, etc. Compare this to C or assembly, where the program can jump to bad instructions, or try reading nonexistent parameters to functions (think va_args), etc.)</li><li>Runtime security checks when loading in new code. The use of SecurityManager and ClassLoader make it easy for the Java runtime to prevent arbitrary code from executing on the computer by mediating access to system resources and preventing the program from loading or generating arbitrary code at runtime. Compare this to C or C++, which can read and write arbitrary values, issue arbitrary system calls, generate and execute arbitrary code, etc.</li><li>Library-level safety of certain features. For example, String is immutable and final, so a function that receives a String can verify the string and not have to worry about another thread changing its value.</li></ol><p>This isn’t a complete list of Java’s safety features, but it should give you a sense of some of the design considerations in Java that are not present in other languages.</p><h4>How to write a more secure code ?</h4><p>Principles to keep in mind if you want your applications to be secure:</p><ul><li><strong>Never trust any input!</strong></li><li><a href="http://www.ibm.com/developerworks/library/l-sp2.html">Validate input</a> from all untrusted sources — use whitelists not blacklists</li><li>Plan for security from the start — it’s not something you can bolt on at the end</li><li>Keep it simple — complexity increases the likelihood of security holes</li><li>Keep your <a href="http://en.wikipedia.org/wiki/Attack_surface">attack surface</a> to a minimum</li><li>Make sure you <a href="http://www.owasp.org/index.php/Fail_securely">fail securely</a></li><li>Use <a href="https://buildsecurityin.us-cert.gov/bsi/articles/knowledge/principles/347-BSI.html">defence in depth</a></li><li>Adhere to the principle of <a href="https://buildsecurityin.us-cert.gov/bsi/articles/knowledge/principles/351-BSI.html">least privilege</a></li><li>Use <a href="http://www.owasp.org/index.php/Threat_Risk_Modeling">threat modelling</a></li><li><a href="http://www.cgisecurity.com/owasp/html/ch04s09.html">Compartmentalize</a> — so your system is not all or nothing</li><li>Hiding secrets is hard — and secrets hidden in code won’t stay secret for long</li><li>Don’t write your own crypto</li><li>Using crypto doesn’t mean you’re secure (attackers will look for a weaker link)</li><li>Be aware of <a href="http://www.linuxjournal.com/article/6701">buffer overflows</a> and how to protect against them</li></ul><p>There are some excellent books and articles online about making your applications secure:</p><ul><li><a href="http://rads.stackoverflow.com/amzn/click/0735617228"><strong>Writing Secure Code 2nd Edition</strong></a><strong> — </strong>I think every programmer should read this</li><li><a href="http://rads.stackoverflow.com/amzn/click/020172152X">Building Secure Software: How to Avoid Security Problems the Right Way</a></li><li><a href="http://rads.stackoverflow.com/amzn/click/0596003943">Secure Programming Cookbook</a></li><li><a href="https://docs.google.com/viewer?url=http://www.usenix.org/events/sec04/tech/slides/mcgraw.pdf">Exploiting Software</a></li><li><a href="http://www.cl.cam.ac.uk/~rja14/book.html">Security Engineering</a> — an excellent read</li><li><a href="http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO/index.html">Secure Programming for Linux and Unix HOWTO</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0a2efbed3e5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/learn-java-for-android-development/why-java-is-secure-compared-with-other-programming-languages-e0a2efbed3e5">Why java is secure compared with other programming languages?</a> was originally published in <a href="https://medium.com/learn-java-for-android-development">Learn Java for Android Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java Byte code compatibility]]></title>
            <link>https://medium.com/learn-java-for-android-development/java-byte-code-compatibility-eeb74dc210a1?source=rss----59f605d28ff1---4</link>
            <guid isPermaLink="false">https://medium.com/p/eeb74dc210a1</guid>
            <dc:creator><![CDATA[Krishna]]></dc:creator>
            <pubDate>Thu, 02 Oct 2014 03:16:29 GMT</pubDate>
            <atom:updated>2014-10-02T03:16:29.260Z</atom:updated>
            <content:encoded><![CDATA[<p>JVM bytecode is forward compatible between major JVM version, but not backward compatible. However, for the best information you will have to read the JVM release notes because they typically indicate how backward compatible the bytecode is.</p><p>some important threads</p><p><a href="http://stackoverflow.com/questions/4061965/if-i-compiled-a-java-file-in-the-newest-jdk-would-an-older-jvm-be-able-to-run-t"><strong>If I compiled a java file in the newest JDK, would an older JVM be able to run the .class files?</strong></a></p><p><a href="http://stackoverflow.com/questions/1011706/backport-java-5-6-features-to-java-1-4"><strong>Backport Java 5/6 features to Java 1.4?</strong></a></p><p><a href="http://stackoverflow.com/questions/4780560/can-a-class-file-generated-using-a-32-bit-java-compiler-be-used-on-a-64-bit-sys"><strong>Can a .class file generated using a 32 bit java compiler be used on a 64 bit system with 64 bit JVM?</strong></a></p><p><a href="http://stackoverflow.com/questions/1011706/backport-java-5-6-features-to-java-1-4"><strong>Backport Java 5/6 features to Java 1.4?</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eeb74dc210a1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/learn-java-for-android-development/java-byte-code-compatibility-eeb74dc210a1">Java Byte code compatibility</a> was originally published in <a href="https://medium.com/learn-java-for-android-development">Learn Java for Android Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction To Java]]></title>
            <link>https://medium.com/learn-java-for-android-development/introduction-to-java-a95d84a681bd?source=rss----59f605d28ff1---4</link>
            <guid isPermaLink="false">https://medium.com/p/a95d84a681bd</guid>
            <dc:creator><![CDATA[Krishna]]></dc:creator>
            <pubDate>Thu, 02 Oct 2014 03:13:46 GMT</pubDate>
            <atom:updated>2014-10-02T03:20:35.204Z</atom:updated>
            <content:encoded><![CDATA[<h4>What is Java?</h4><p>Android applications are developed using the Java language. Java is a very popular programming language developed by Sun Microsystems (now owned by Oracle). Developed long after C and C++, Java incorporates many of the powerful features of those powerful languages while addressing some of their drawbacks. Still, programming languages are only as powerful as their libraries. These libraries exist to help developers build applications.</p><p>Some of the Java’s important core features are:</p><ul><li>It’s easy to learn and understand</li><li>It’s designed to be platform-independent and secure, using<br>virtual machines</li><li>It’s object-oriented</li></ul><p>Android relies heavily on these Java fundamentals. The Android SDK includes many standard Java libraries (data structure libraries, math libraries, graphics libraries, networking libraries and everything else you could want) as well as special Android libraries that will help you develop awesome Android applications.</p><h4>Why is Java Easy to Learn?</h4><p>Java is easy to learn for a variety of reasons. There’s certainly no shortage of Java resources out there to help you learn the language, including websites, tutorials, books, and classes. Java is one of the most widely discussed, taught, and used programming languages on the planet. It’s used for many different types of programming projects, no matter their scale, from web applications to desktop applications to mobile applications.</p><p>If you’re coming from a traditional programming background like C or C++, you’ll find Java syntax quite similar. If you’re not, then take comfort in knowing that you’ve chosen one of the easiest languages to learn. You’ll be up and running in no time at all.</p><p>Finally, Java is one of the most human-readable languages out there, by which we mean that a person who knows nothing about programming can often look at some Java code and have at least an inkling what it’s doing. Consider the following example:</p><pre>String  name=&quot;krishna&quot;;<br>if(name.equals(&quot;krishna&quot;))<br>{<br>  System.out.println(&quot;Admin user&quot;);<br>} else {<br>  System.out.println(&quot;Regular user&quot;);<br>}</pre><p>One of the major features of java includes that <a href="http://www.javacode.in/why-java-is-called-platform-independent-language/"><strong>why java is called platform independent language</strong></a><strong>.</strong><br>Before understanding this feature we need to know about -</p><p><strong>Javac – compiler that converts source code to byte code.</strong><br><strong>JVM- interpreter that converts byte code to machine language code.</strong><br>As we know java is both compiler &amp; interpreter based language. Once the java code also known as source code is compiled, it gets converted to native code known as BYTE CODE which is portable &amp; can be easily executed on all operating systems. Byte code generated is basically represented in hexa decimal format. This format is same on every platform be it Solaris work station or Macintosh, windows or Linux. After compilation, the interpreter reads the generated byte code &amp; translates it according to the host machine. . Byte code is interpreted by Java Virtual Machine which is available with all the operating systems we install. so to port Java programs to a new platform all that is required is platform specific JVM and some of the library routines.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a95d84a681bd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/learn-java-for-android-development/introduction-to-java-a95d84a681bd">Introduction To Java</a> was originally published in <a href="https://medium.com/learn-java-for-android-development">Learn Java for Android Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>