Archive for the ‘Java’ Category

Prime Number in Java

This item was filled under [ Java, Tutorial ]

Simple Code “Prime Number In Java”
class Prime_number {
public static void main(String[] args) {
int num = 11; //number that u want to check
int i;
for (i=2; i < num ;i++ ){
int n = num%i;
if (n==0){
System.out.println(“not Prime!”);
break;
}
}
if(i == num){
System.out.println(“Prime number!”);
}
}
}

Continue reading...

Tagged with: [ , ]

Factorial In Java

This item was filled under [ Example, Java, Programming, Tutorial ]

Simple code “Factorial in Java”
public class Factorial {
public static long factorial( int n ) {
if( n <= 1 )
return 1;
else
return n * factorial( n - 1 );
}

public static void main( String [ ] args ) {
for( int i = 1; i <= 10; i++ )
System.out.println( factorial( i ) );
}
}

Continue reading...

Tagged with: [ , ]

Setting EditPlus

This item was filled under [ Java, Programming, Tutorial ]

Untuk bisa meng-compile dan menjalankan Java di EditPlus kita perlu menghubungkan EditPlus dengan Java itu sendiri.
Untuk itu diperlukan menu Compile dan Run yang dikonfigurasi melalui pengaturan Tools pada EditPlus.
Berikut langkah-langkahnya.

Continue reading...

Tagged with: [ , ]

Class Libraries Of JAVA

This item was filled under [ Java, Programming ]

Java libraries are the compiled byte codes of source code developed by the JRE implementor to support application development in Java. Examples of these libraries are:

The core libraries, which include:

Collection libraries that implement data structures such as lists, dictionaries, trees and sets
XML Processing (Parsing, Transforming, Validating) libraries
Security
Internationalization and localization libraries

The integration libraries, [...]

Continue reading...

Tagged with: [ , ]

Special Classes Of JAVA

This item was filled under [ Java, Programming ]

Applet

Main article: Java applet

Java applets are programs that are embedded in other applications, typically in a Web page displayed in a Web browser.

// Hello.java
import javax.swing.JApplet;
import java.awt.Graphics;

public class Hello extends JApplet
{
public void paintComponent(Graphics g)
{
g.drawString("Hello, world!", 65, 95);
[...]

Continue reading...

Tagged with: [ , ]

Example Of JAVA

This item was filled under [ Java, Programming ]

Hello world
The traditional Hello world program can be written in Java as:

/**
* Outputs “Hello, World!” and then exits
*/
public class HelloWorld {
public static void main(String[] args) {
System.out.println(”Hello, World!”);
}
}

By convention, source files are named after the public class they [...]

Continue reading...

Tagged with: [ , ]

Syntax of JAVA

This item was filled under [ Java, Programming ]

The syntax of Java is largely derived from C++. Unlike C++, which combines the syntax for structured, generic, and object-oriented programming, Java was built almost exclusively as an object oriented language. All code is written inside a class and everything is an object, with the exception of the intrinsic data types (ordinal and real numbers, [...]

Continue reading...

Tagged with: [ , ]

Philosophy Of JAVA

This item was filled under [ Java, Programming ]

Primary goals
There were five primary goals in the creation of the Java language:[10]

It should be "simple, object oriented, and familiar".

It should be "robust and secure".

It should be "architecture neutral and portable".

It should execute with "high performance".

It should be "interpreted, threaded, and dynamic".

Java Platform

Main article: Java Platform [...]

Continue reading...

Tagged with: [ , ]

History Of JAVA

This item was filled under [ Java, Programming ]

James Gosling initiated the Java language project in June 1991 for use in one of his many set-top box projects.[4] The language, initially called Oak after an oak tree that stood outside Gosling’s office, also went by the name Green and ended up later renamed as Java, from a list of random words.[5] Gosling aimed [...]

Continue reading...

Tagged with: [ , ]

Introduction To JAVA

This item was filled under [ Java, Programming ]

Java is a programming language originally developed by Sun Microsystems and released in 1995 as a core component of Sun Microsystems’ Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. Java applications are typically compiled to bytecode that can run on [...]

Continue reading...

Tagged with: [ , ]