<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="https://code-reference.com/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://code-reference.com/feed.php">
        <title>Programming | Library | Reference - Code-Reference.com java:variables</title>
        <description></description>
        <link>https://code-reference.com/</link>
        <image rdf:resource="https://code-reference.com/ttps://code-reference.com/lib/tpl/dokuwiki/images/favicon.ico" />
       <dc:date>2026-05-18T17:31:08+02:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://code-reference.com/java/variables/array?rev=1366179085&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/java/variables/define_a_block?rev=1365165752&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/java/variables/global_variable?rev=1708041842&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://code-reference.com/ttps://code-reference.com/lib/tpl/dokuwiki/images/favicon.ico">
        <title>Programming | Library | Reference - Code-Reference.com</title>
        <link>https://code-reference.com/</link>
        <url>https://code-reference.com/ttps://code-reference.com/lib/tpl/dokuwiki/images/favicon.ico</url>
    </image>
    <item rdf:about="https://code-reference.com/java/variables/array?rev=1366179085&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2013-04-17T08:11:25+02:00</dc:date>
        <title>Arrays in Java</title>
        <link>https://code-reference.com/java/variables/array?rev=1366179085&amp;do=diff</link>
        <description>an array, it is a object variable (box,container), which is a variable in a position to take up more than one object of the same type and manage it

example of arrays in java


package arrays;

public class Arrays {

    public static void main(String[] args) {
           int[] digits1; // Reference Variable
           int[] digits2= new int[5]; // Definition with 5 x Integer
           int[] digits3= {1,2,3,4,5}; // Definie with initialization ( 5 Integer)
           
           // pass Element…</description>
    </item>
    <item rdf:about="https://code-reference.com/java/variables/define_a_block?rev=1365165752&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2013-04-05T14:42:32+02:00</dc:date>
        <title>create a block</title>
        <link>https://code-reference.com/java/variables/define_a_block?rev=1365165752&amp;do=diff</link>
        <description>create a block

description

define a block for local variables



        /**
         * Block for local variables
         */
        {

            int help=5;
            System.out.println(help);
         } // block content is now trashed
        
       // System.out.println(help); // not possible to access the help variable</description>
    </item>
    <item rdf:about="https://code-reference.com/java/variables/global_variable?rev=1708041842&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:02+02:00</dc:date>
        <title>global variable</title>
        <link>https://code-reference.com/java/variables/global_variable?rev=1708041842&amp;do=diff</link>
        <description>define a global variable in java, after the public class block

example of global varialbe  in java


 package codereferececomjava;

public class CodeRefereceComJava {

    public static int globalDigit; // define a global variable
 
    public static void main(String[] args) {
                
        int digit = 5; // define and inital a local variable
        globalDigit = digit; // initalisize the global variable
        
        funct(); // call funct();
    }

    
    public static void f…</description>
    </item>
</rdf:RDF>
