Java tutorial-Java programming ?


What is Java programming language?

Java is one of the most popular and powerful programming languages that can be run on different OS such as Windows, Mac, Linux, etc. It is a full OOP (Object-Oriented Programming) language which was developed by Sun Microsystems company. Java is more simpler to learn if we it compare to C or C++ programming languages. The basics of Java are very similar to those of C and its OOP is influenced by C++.

 

Java development requirements

-You need to download and install JDK tool kit from Sun's Java site.

-Add bin directory to your window PATH:

    Control Panel-->System-->Advanced tab/Advanced System Settings-->Environment Variable-->Select Path-->Edit-->type ";C:\Program Files\Java\jdkversion\Bin" at the end of the line. 

-Use Editor like Notepad, Eclipse, or JCreator to write and/or compile your Java code.

In the next pages of Java tutorial you will learn Java programming language from basic  to advanced concepts such as how to install Java development toolkit, how to compile and run the programs, understanding variables and data types, using comments, reading values from keyboard, printing values on the screen, string manipulation, conditional statements, loops, arrays, object-oriented programming, package, error handling, graphical user interface (GUI), file stream, database manipulation, and drawing, etc.



Comments

CAPTCHA image
Dara comment

 Dara

This code might help you:

public class TowerofHanoi {
public static void main(String[] args){
tower(3,'A','B','C');
}

public static void tower(int n, char source, char temp,char destination){
if(n==1){
System.out.println("Move 1 disk from "+source+" to "+destination);
}
else{
tower(n-1, source,destination,temp);
System.out.println("Move 1 disk from "+source+" to "+destination);
tower(n-1, temp,source,destination);
}
}
}


2013-10-22 10:10:00
Muhak comment

 Muhak

Can anyone help me to write a recursive method in Java to move n disks from a source pillar to a destination pillar? Your help is appreciated.
Thanks


2013-10-22 10:09:00
ly comment

 ly

Immutable class point in Java (using final):

public final class Point {

private final int x;
private final int y;


public Point(int x, int y) {
this.x = x;
this.y= y;

}

public void printpt() {
System.out.println("("+x+","+y+")");
}


}


2012-11-05 19:16:00
hshg comment

 hshg

solution of this question in oop: Object of type String are immutable which means that once you create them you cannot change them:
Create a class called MyPoint which is also immutable and which has the following instance variable and methods:
1-x coordinate
2-y coordinate
3-print method to output the point.
Please answer the question thanks,,,


2012-11-05 11:12:00



This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages:
C, C++, C#, Java, VB.NET, Python, VBA,PHP & Mysql, SQL, JSP, ASP.NET,HTML, CSS, JQuery, JavaScript and other applications such as MS Excel, MS Access, and MS Word. However, we don't guarantee all things of the web are accurate. If you find any error, please report it then we will take actions to correct it as soon as possible.