Java (lugha ya programu)

Java ni lugha ya programu. Iliundwa na James Gosling na ilianzishwa tarehe 23 Mei 1995. Iliundwa ili kuumba programu kwa Android. Leo tunatumia Java SE 13. Ilivutwa na C++.

 Historia 
Ilianzishwa mwaka wa 1995 nchini Marekani. James Gosling, Mike Sheridan, na Patrick Naughton walianza kufanya kazi kuhusu Java mwaka wa 1991. Mwaka wa 1996 Sun Microsystems ilichapa Java 1.0.

 Falsafa 
Namna ya Java ni ile inaozingatiwa kuhusu kipengee na namna nyingi.

 Sintaksia 
Sintaksia ya Java ni ngumu sana; inafananishwa na lugha za programu nyingine kama JavaScript, Python au Ruby. Ilivutwa na sintaksia ya C++, lugha ya programu nyingine.

 Mifano ya Java 
Programu kwa kuchapa « Jambo ulimwengu !».

public class JamboUlimwengu {
    public static void main(String[] args) {
        System.out.println("Jambo ulimwengu !");
    }
}

Programu kwa kutafuta thamani katika jedwali.

class Mfano2 {
    public static void main(String[] args) {
        int[] table = {12, -5, 7, 8, -6, 6, 4, 78, 2};
        byte elt = 4;
        short i;
        for (i = 0; i < 8; i++) {
            if (elt == table[i]) {
                break;
            }
        }
        afficher(i, elt);
    }

    static void afficher(int rang, long val) {
        if (rang == 8) {
            System.out.println("thamani : " + val + " haitafutwi.");
        } else {
            System.out.println("thamani : " + val + " thamani anatafutwa in rank :" + rang);
        }
    }
}

 Marejeo 
 Binstock, Andrew (May 20, 2015). "Java's 20 Years of Innovation". Forbes. Archived from the original on March 14, 2016. Retrieved March 18, 2016.
 Chaudhary, Harry H. (July 28, 2014). "Cracking The Java Programming Interview :: 2000+ Java Interview Que/Ans". Retrieved May 29, 2016.
 Java 5.0 added several new language features (the enhanced for loop, autoboxing, varargs and annotations), after they were introduced in the similar (and competing) C# language. [1] Archived March 19, 2011, at the Wayback Machine [2] Archived January 7, 2006, at the Wayback Machine
 Gosling, James; McGilton, Henry (May 1996). "The Java Language Environment". Archived from the original on May 6, 2014. Retrieved May 6, 2014.

Jamii:Kompyuta
Jamii:Lugha za programu