Home Java Beginners Beginners Java Tutorial
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

Beginners Java Tutorial

Advertisement
This tutorial will introduce you with the Java Programming language. This tutorial is for beginners, who wants to learn Java from scratch. In this beginners Java Tutorial you will learn how to download and install JDK on your machine and then use the JDK

Beginners Java Tutorial

     

This tutorial will introduce you with the Java Programming language. This tutorial is for beginners, who wants to learn Java from scratch. In this beginners Java Tutorial you will learn how to download and install JDK on your machine and then use the JDK to develop Java programs.

   Java Basic

  1. What is Programming?
    Programming or coding is a language that is used by operating systems to perform the task. We know computer understands binary languages with digits 1s and 0s.
     
  2. What is Java?
    Java is a high-level object-oriented programming language developed by the Sun Microsystems. Though it is associated with the World Wide Web but it is older than the origin of Web.
      
  3. Where Java is used?
    The programming language Java was developed by Sun Microsystems in the year 1995. Earlier, it was only used to design and program small computing devices but later adopted as one of the platform independent programming language.
         
  4. Java Releases
    Java is developed by Sun Microsystems in 1996. The tables given below provide information about the name and time of releases for different versions of Java technology. 
     
  5. Downloading JDK (Java)
    In this lesson you will learn how to download java from the sun web site.
     
  6. Installing JDK 7, Installing Java Version 5
    In this lesson you will learn how to install and configure java on your machine.
     
  7. Understanding Java SDK Directory Structure
    This section introduces the Directory and file structure of SDK (Software Development Kit). 
     
  8. Writing Hello World Java program
    In this lesson we will learn how to write, compile and test the Hello World java application.
      
  9. Understanding Hello World Java Program
    In this lesson we will understand the Hello World Java program.

Here are more detailed tutorials for beginners:

  1. Comparing Two Numbers
    This is a very simple example of Java that teaches you the method of comparing two numbers and finding out the greater one. First of all, name a class "Comparing" and take two numbers in this class. Here we have taken a=24 and b=25, now we have to find out whether a=b, a>b or b>a. 
      
  2. Determining the largest number
    This example of Java programming will teach you the coding for determining the largest number amongst three. Here we have taken three integers as x = 500, y = 70 and z = 3000.
     
  3. List all even numbers between two numbers
    Here you will learn to write a program for listing out all the even numbers between two numbers. For this first create a class named AllEvenNum under the java.io package.

     
  4. Calculate area and perimeter of a circle
    The given example will teach you the method for preparing a program to calculate the area and perimeter of a circle.
     
  5. Calculate factorial of any given number
    This Java programming tutorial will teach you the methods for writing program to calculate factorial of any given number. First of all define a class "Factorial" under the Java I/O package.
      
  6. Palindrome Number Example in Java 
    In this section, you will learn about the palindrome number and how to determine any number is palindrome or not. First of all we are going to read about the palindrome number. 
      
  7. Program for calculating area and perimeter of a rectangle
    If you are a newbie in Java programming then our tutorials and examples will be helpful in understanding Java programming in the most simplest way. Here after reading this lesson, you will be able to write program for calculating the area and perimeter of a rectangle.
     
  8. Program to construct a triangle with the ?*? 
    This lesson in Java programming will teach you the coding for constructing a shape of triangle by using '*'.
     
  9. Checking whether a year is leap or not
    This tutorial is going to teach you the coding for checking whether a year is a leap year or not. Here, we have taken the year 2000.
     
  10. Listing out leap years between certain period
    The programming lesson will teach you the coding for finding and listing out the leap years between two years. In the following example we have to find out the leap years between 1990 and 2006.
     
  11. Preparing table of a number by using loop
    This tutorial will teach you the methods of preparing the table of a given number by using loop condition. As we know the loop statements are used to repeat a statement or process multiple times according to a specified condition.
     
  12. Finding out the prime number
    This lesson of Java programming language will teach you the coding to find out whether a given number is prime or not. Here we have used the 'for loop' statement and given the required condition for a prime number.
      
  13. Prime Number in Java
    This Java programming tutorial, we will be read how to get prime number between 1 to given number. First of all we have to define a class "PrimeNumber".

     
    Java OOP Concept
      
  14. OOP In Java
    Object Oriented Programming or OOP is the technique to create programs based on the real world. Unlike procedural programming, here in the OOP programming model programs are organized around objects and data rather than actions and logic.
     
    Java Examples
      
  15. Exception Handling in Example
    Exception, that means exceptional errors. Actually exceptions are used for handling errors in programs that occurs during the program execution.
      
  16. Java Identifier Example
    In this example you will learn what is identifier and primitive data type of a identifier. This tutorials will teach you how to use these identifier in you  java programming.
      
  17. Java - Variable, Constant and Literal in Java
    Variable : You can assign the values to the variable once it has been declared. The values of the variable can be changed anywhere in the program if the variable is accessible in that scope. In this example we have used the variable  intvariable to illustrate this.
     
  18. Java Read File Example
    In the section of Java Tutorial you will learn how to write java program to read file line by line. We will use the DataInputStream class to Read text File Line by Line.
      
  19. Copy file Example
    This example illustrates how to copy contents from one file to another file. This topic is related to the I/O (input/output) of java.io package.
      
  20. Java Write to File Example
    In the section of Java Tutorial you will learn how to write java program to write to a file.
     
  21. Java Create Directory Example
    In the section of Java Tutorial you will learn how to write java program to create directory.
      
  22. Deleting Directory or File
    This example illustrates how to delete the specified file or directory after checking weather the file exists or not. This topic is related to the I/O (input/output) of java.io package.
     
  23. Java Directory Listing Example
    This example illustrates how to list files and folders present in the specified directory. This topic is related to the I/O (input/output) of java.io package.
      
  24. Java Word Count Example
    This example illustrates how to count the number of lines, number of words and number of characters in the specified file. Program takes the file name as parameter and it counts the number of words and lines present in the file. 

      
  25. Applet Example in Java
    Applet is a program provided by java which is designed for execution within the web browser. Applets are mostly used for a small internet and intranet applications because of small size and it's compatibility among almost all web browsers.
      
  26. Boolean Expression in Java
    In this example you will see that how the expression returns a boolean value which is either true or false. This example illustrates you how to make a boolean expression by using relational operators and how to use the returned value of the expression.
      
  27. Math Class Example
    In this example you will learn about Math class. This example explains how you can use functions provided by the Math class like E, PI, round, abs, ceil, exp, floor, IEEEremainder, max, min, pow, random, rint, sqrt etc. to manipulate the mathematical operation in your program.
      
  28. String Buffer Example
    In this example you will learn about StringBuffer class. This example explains how you can use functions provided by the StringBuffer class like append, insert, reverse, setCharAt, charAt, length, deleteCharAt, substring, delete, capacity etc. to manipulate the string operation in your program.
     
  29. Type Casting Example
    This example illustrates that what is type casting? Type Casting  refers to changing an entity of one datatype into another. This is important for the type conversion in developing any application.
      
  30. Java - Array in Java
    Array: Array is the most important thing in any programming language. By definition, array is the static memory allocation. It allocates the memory for the same data type in sequence. It contains multiple values of same types.
     
  31. Copying an array to another
    In this tutorial, you will learn how to copy data from one array to another. Here, providing you an example with code and its explanation to given below.
     
  32. charAt() method in Java
    In this section, you will get the detailed explanation about the charAt() method of String class. We are going for using charAt() method.
      
  33. length() method in Java
    In this section, you will learn how to use length() method of the String class. We are going to using length() method.
     
  34. toUpperCase() Method In Java
    Here, you will see the procedure of converting letters of the string in uppercase letter.
      
  35. String Array in Java
    In this section, you will learn how to use string array in Java. Here, you will see how to declare a string array and the syntax for using in the program.
     
  36. Average of Array
    In this section, we will learn how to get an average of array. For this, first of all we have to define a class name "ArrayAverage" that has double type array to contain some values.
     
  37. Matrix Example in Java
    In Java tutorial, you will learn about array and matrix. An array is the collection of same data type values. If we create a variable of integer type then, the array of int can only store the int values.
      
  38. Sum of  two Matrix
    In this section, we are going to calculate the sum of two matrix and containing its rows and columns. See below for better understanding to this.
      
  39. Multiplication of two Matrix 
    This is a simple java program that teaches you for multiplying two matrix to each other. Here providing you Java source code with understanding the Java developing application program.
       
  40. Square Elements of Two Dimensional Array 
    This is a simple java program for implementing the two dimensional array program and its square. This session provide you the best explanation with mathematical operation.
     
     
  41. Check Even-Odd:-Example
    Now, you have to learn about the syntax of If - Else construct. How the If - Else construct used to flow the program control as for as needed.
     
  42. Java - Break statement in java
    Break: The break statement is used in many programming languages such as c, c++, java etc. Some times we need to exit from a loop before the completion of the loop then we use break
     
  43. Java - Continue statement in Java
    Continue: The continue statement is used in many programming languages such as C, C++, java etc. Sometimes we do not need to execute some statements under the loop then we use the continue statement that stops the normal flow of the control and control returns to the loop without executing the statements written after the continue statement.
     
  44. Java - The switch construct in Java
    Switch is the control statement in java which also turns the normal flow control of the program as per conditions. It works same as If-Else construct. This is the difference between Switch and If-Else construct that switch is used for reduce the if statements.
      
  45. Switch Statement example in Java 
    This is very simple Java program for implementing the switch statement. Here, you will learn how to use the switch statement in your java program for developing java application.
      
  46. While Loop
    Loop is the control statement of any language in which whenever you want to perform the repetitious work then you use the Loop control statement.
      
  47. do-while Loop in Java
    In some conditions in java, you need to run some statements and processes once at least. For that you have to use the do while loop in  after that check the condition then we use the do-while loop statement.
      
  48. For Loop in Java
    The for loop is the type of  looping construct. It also works as while loop construct but it provide the initialization, condition and the increment  is same written in the for construct.
      
  49. Java - Class, Object and Methods in Java
    Class : Whatever we can see in this world all the things are a object. And all the objects are categorized in a special group. That group is termed as a class.
     
  50. Java - Constructor in java
    Constructor is the method which name is same to the class. But there are many difference between the method (function) and the Constructor.
     
  51. Constructor Overloading in Java
    Constructors are used to assign initial values to instance variables of the class. A default constructor with no arguments will be called automatically by the Java Virtual Machine (JVM).
      
  52. Use of "this" keyword in java
    The keyword this is useful when you need to refer to instance of the class from its method.
      
  53. Java - Threads in Java
    Thread is the feature of mostly languages including Java. Threads allow the program to perform multiple tasks simultaneously. Process speed can be increased by using threads because the thread can stop or suspend a specific running process and start or resume the suspended processes.
     
  54. Occurrences of elements in an Array
    This section illustrates you how to calculate occurrences of elements in an array. Occurrences means, the how many times an element occurs in the array.
      
  55. Change the user input to integer
    Isn't it a very tedious job to enter the values each time before the compilation in the method itself. Now if we want to enter an integer value after the compilation of a program and force the JVM to ask for an input, then we should use Integer.parseInt(string str) .
      
  56. Making Tokens of a String
    We have to break a String  into tokens as well as we will know how many tokens has been generated. That's what we are trying to do in this program.
     
  57. Array List Example in java
    In this example we are going to show the use of java.util.ArrayList. We will be creatiing an object of ArrayList class and performs various operations like adding removing the objects.
      
  58. Converting a Filename to a URL
    A file object is used to a give a filename. Creating the File object doesn't mean that a file exists. It may be that the does not exist. Suppose if the file exists, first of all we need to convert the file object in URL, for this we use a method toURL(). It returns a URL object and throws MalformedException. After this we will convert this URL to a file object by using getFile() method. We will read this file by using BufferedReader object.
      
  59. Creating a temporary file
    In this program we are going to make a temporary file, which will be deleted automatically by the garbage collector when the program ends.
     
  60. Example of Date class
    We can use Date class to use current date. In this program we are creating a Date object and by using it we are going to display the current date and time. It implements Serializable, Cloneable, Comparable interfaces. Its known subclasses are Date, Time, Timestamp
     
  61. Determining if two Filename paths refer to the same file.
    This program is going to determine that the file name refers to the same file or not. What you need to do is to create two File object and pass the file name in the constructor of both the File class. Now match both the file instances. It will return false if the file paths are not equal. To send the true value we first have to normalize both the paths, only after that  it will return true.
     
  62. Determining if a Filename path is a file or a directory
    You can solve this problem very easily. What you need to do, just create a File object and pass some file name or a directory in it.
     
  63. Determining if a File or Directory exist
    This is a very simple problem. You just have to determine whether a file or directory exists or not. If it exists it returns true otherwise in the else condition, it retunes vice-versa.
     
  64. Forcing Updates to a File to the Disk
    In this program we are going to update a file forcefully. Firstly we have to make an object of OutputStream and pass a file name in which you want to update in the constructor of a FileOutputStream class. After that pass some data to the stream. The methods we are using in this class has already been discussed in other topics.
      
      
  65. Link List Example in Java
    In this example we are going to show the use of java.util.LinkedList class. You will be creating an object of link list class and performing various operation like adding and removing object.
       

  66. Listing the File System Roots
    In this example we will list out all the drives in the disk. this requires an array of File class where all the drives will get stored by using only one method.
      

  67. Reading a File into a Byte Array
    In this program we will read a file in the form of a byte array. We can do it very easily. Firstly we will create an object of File class and pass the name of the file which we want to read, in the constructor of File class. We will use DataInputStream to read primitive data types.
      

  68. Implementing a Serializable Singleton
    In Singeton classes only one instance will be created. We are going to serialize the class. This can be done very easily. What we need to do is to implement a java.io.Serializable interface. We will use a method of Serializable interface that is readResolve().
      

  69. Example of Java Stack Program
    Stack is like a bucket we you can enter objects and retrieve it. Here in the example describes the methods to prepare an example of Java stack program. The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector and implements Cloneable, Collection, List, Serializable interfaces. We mostly use push and pop operations.
     

  70. Vector Example in java
    In this example we are going to show the use of java.util.Vector class. We will be creating an object of Vector class and performs various operation like adding, removing etc. Vector class extends AbstractList and implements List, RandomAccess, Cloneable, Serializable. The size of a vector increase and decrease according to the program. Vector is synchronized.
      
  71. Calculating the checksum of a file/Adler32
    Adler32:
    It is a error checking technique used to check the accuracy of data while transmitting it to the other end. Errors are checked while the data is transferring. This scheme is as reliable as CRC32, but it is much faster to compute.
     
  72. Calculating the Checksum of the file/CRC32
    CRC:
      CRC means Cyclic Redundancy Check. It is a error checking technique used to check the accuracy of data while transmitting it to the other end. Errors are checked while the data is transferring. CRC performs some type of calculation before transmitting the data and send the result to the other end. The other end repeats the same operation before accepting the data. If both the devices get the result same, it means the transmission is error free. 
      
  73. Compressing the file into GZIP format.
    This example will help to understand the concepts of GZIP. GZIP compresses the actual size of data files.  It is a file compression utility program which can be found very easily found on internet. Its resultant file will have a .gz extension. Its main advantage is that it provides excellent levels of compression. It can be used where you want to save the file in less available area. It will compress the file to the great extent. It is a part of java.util.zip package.
     
  74. Constructing a File Name path 
    This Java programming tutorial will teach you how you can construct a file name path. By using the constructing filename path it is possible to set dynamic path, which is helpful for mapping local  file name with the actual path of the file. 
     
  75. Use of Array in Java
    This Java programming example will teach you the the concepts of arrays so that you can write a program on array by yourself. An array works a container object which can hold a values of same type. The length of an array is created when the array is going to be created. Arrays can be created in following ways. One way to create a array is by using new operator. e.g.. : a = new int[5];. It will create an array of type int which can store 5 integer values. The next way to define array is just same as we have defined an array in the program below.  Array should be used,  where you have to store multiple values of the same type.
    For example if we have to store months of the year then the better idea is to make an array of it.
      
  76. Example of static method
    This Java programming example will teach you the way to define a static methods. In java we have two types of methods, instance methods and static methods. Static methods can't use any instance variables. The this keyword can't be used in a static methods. You can find it difficult to understand when to use a static method and when not to use. If you have a better understanding of the instance methods and static methods then you can know where to use instance method and static method.
     
  77. Uncompressing the file in the GZIP format.
    This example will help you to understand the concepts of GZIP.  Sometimes it happens that when you download a file or any PDF  file you get it in compressed mode. This means that the file is compressed, but can't read it in compressed form so, it needs to be uncompressed. There are various uncompress ion utility program which can be found very easily found on internet. If you are uncompressing a PDF with the extension .gz, then its resultant file will have a .PDF extension. Its main advantage is that it will uncompress the PDF file so that you can be able to read it. This utility is a part of java.util.zip package which provides classes and methods to compress and decompress the file.
     
  78. Example of a instance variable
    When a number of objects are created from the same class,  the same copy of  instance variable is provided to all. Remember, each time you call the instance the same old value is provided to you, not the updated one . In this program we are showing that how a instance variable is called in each instance, but the copy remains same irrespective the counter we have used in the constructor of a class. We can't call the non-static variable in a main method. If we try to call the non-static method in the main method then the compiler will prompt you that non-static variable cannot be referenced from a static context. We can call the non-static variable by the instance of the class.
     
  79. Example of a class variable (static variable)
    This Java programming example will teach you how you can define the static class variable in a class. When a number of objects are created from the same class, each instance has its own copy of class variables. But this is not the case when it is declared as static static.
      
  80. Swapping of two numbers
    This Java programming tutorial will teach you the methods for writing program to calculate swap of two numbers. Swapping is used where  you want to interchange the values. This program will help you to increase your programming ability.
      
  81. Swap two any numbers (from Keyboard)
    This is a simple Java Oriented  language program. If  you are newbie in Java programming then our tutorial and example are helpful for understanding Java programming in the simplest way.
     
  82. Calculating the checksum of a Byte Array by using Adler32
    Adler32: It is a error checking technique used to check the accuracy of data while transmitting it to the other end. Errors are checked while the data is transferring. This scheme is as reliable as CRC32, but it is much faster to compute.The byte is an 8- bit signed primitive data type quantity. The minimum value the byte is -128 and maximum value is +128. It is signed because it can take both negative and positive value. The Byte class wraps a value of primitive type byte in an object. A object of type Byte contains a single field whose type is byte.
      
  83. Calculating the checksum of a Byte Array by using CRC32
    CRC32: It is a error checking technique used to check the accuracy of data while transmitting it to the other end. Errors are checked while the data is transferring.
     
  84. Comparing the File Dates
    This java example will help you to compare the dates of files. In java we have the option to compare two or more files. This is useful when we have to compare the files. Mostly it happens that after creating a file or a directory we forgets when it was made or last modified, and sometimes it becomes essential to know the exact date and time of creation. By this example you will be able to understand it. 
     
  85. Getting a absolute path
    To find a file or directory it is very necessary to know the path of the file or directory so that you can access it. If you know the path then it is very easy to work on it. Suppose a situation where a problem comes in front you where you don't know the path of the file, then what will you do. Then this problem can be solved by using a method getAbsolutePath(). The method getAbsolutePath() should be used where we don't know the exact path of the file.
      
  86. Making Tokens of a Java Source Code
    If you are new in Java programming then our tutorials and examples will be helpful in understanding Java programming in the most simplest way. Here after reading this lesson, you will be able to break java program into tokens. 
     
  87. Add two big numbers
    In this section, you will learn how to add two big numbers. For adding two numbers implement two big decimal numbers then apply the Sum() method that takes both numbers. 

  88. String Buffer insert and append example
    In this section, you will learn how to insert StringBuffer and append data. The StringBuffer is a class that implements multiple sequence of characters. The following program construct a string buffer that has '0' capacity.  

  89. Character Comparison Example 
    In this section, you will learn how to compare characters in Java. The java.lang package provides a method for comparing two case sensitive  strings. The compareTo() method compares two strings on the basis of Unicode of each character of the given strings.   

  90. Comparison character cases ignoring case sensitiveness in java
    In this section, you will learn how to compare two strings ignoring case sensitiveness  Java provides the method that ignores cases, it only compare the character's  sequence. The compareToIgnoreCase() method compares two strings and ignores its cases.

  91. Combine String example
    In this section, you will learn how to combine or merge two strings in java. The java.lang package provides the method that helps you to combine two strings and making  into single string.  

  92. Compare string example
    In this section, you will learn how to compare two strings in java. The java lang package provides a method to compare two with their case either upper and lower. The equals() method provides the facility of comparing the two strings.

  93. Replace Character in String 
    This example replaces a character with a specified character in a given string.

  94. Convert String to a float
    In this section, you will learn how to convert string data into a float type data. The java.lang package provides the method that converts string data into float and also converts it into double.

  95. Convert integer type data into binary, octal and hexadecimal
    In this section, you will learn how to convert an integer type data into binary, octal and hexadecimal. The  java.lang package provides the facility for converting the data integer into binary, octal, and hexadecimal. 

  96. Round two decimal places
    In this section, you will learn about how to round the figure up to two decimal places in java.  

  97. String length example
    In this section, you will learn how to get the length of given string. The lang package of java provides the facility for getting the length of string. You will see in the following program for getting the length of string by using the length() method that returns integer type value of any given string

  98. Trim String Example
    In this section, you will learn how to remove the blank spaces. For removing  the blank spaces use trim() method that removes the blank spaces and shows only string. 

  99. String Start with Example
    In this section, you will learn how to check the given string that start from the specified character in java. The following program checks the started string with "Wel".

  100. String End with Example
    This section tells you, how to determine the given string ends with specified string. The following program helps you to check whether the given string starts with the specified string is true or false by applying endsWith() method and returns Boolean types values either 'true' or 'false'.

  101. Passing Command Line Arguments
    In this example we are going to learn how we can pass values on command line argument .

  102. Decimal Format Example
    In this example we are going to format a decimal value.

  103. Delay Example
    In this section we learn how we can make a program so that there are delay between the execution of program.

  104. Line Number Reader Example
    In this example we are reading  number of lines.

  105. Operating System Information
    In this example we are learn how we can get information about our operation system. In this example we are getting the OS name, its version and architecture of OS. We are using getProperty(String key)  to get the property of the OS.

  106. Taking  Substring
    In this example we are taking a sub string from a given string.

  107. Find Current Temp Directory 
    In this example we are find the current Temp directory.

  108. Find User Home Directory 
    In this example we are find user home directory.

  109. Write Text into File
    In this example we are writing text into file. In this example we are initialize string to write into file. We are creating file in which we are writing string by use of write() method.

  110. Word Count
    This example counts the number of occurrences of  a specific word in a string. Here we are counting the occurrences of word "you" in a string. To count it we are using countMatches() method.
      
  111. String Reverse Using StringUtils
    In this example we are going to reverse a given string using StringUtils api. In this example we are reversing a string and the reversed string  is delimited by a specific character.
     
  112. String Reverse in Java
    In this example we are going to reverse a given string.
     
  113. Singleton Design Pattern
    This example explores how to implement a SingletonPattern on a class in java.
      
  114. Runtime Exec Example
    In this example we are going to execute an application using java program.
      
  115. Get Environment Variable Java
    In this example we are getting environment variable. To get the environment variable we use getenv() method.
      
  116. Find Day of Month
    This example explores how to find the day of a month and the day of a week  This example sets the year as 2007 and the day as 181. The example  finds the day of a month and the day of a week by using get(field_name) method.
      
  117. Find the Day of the Week
    This example finds the specified date of  an year and a day of a week from calendar.
      
  118. Date Difference
    This example learns how to make the difference between two dates and how to convert milliseconds into seconds, seconds into minutes, minutes into hours, hours into days.
  119. Calendar Example
    In this section, we are discussing the entire functionality of java.util.Calender class. In the following code segment we are performing various operations on Date object using its methods.
     
  120. Date Comparison
    In this section we are discussing the comparison of two dates, whether they are equal or not, the first date comes before the other or not, the first date comes after the other or not, by using the equals(), before() and after() methods of the date class.
      
  121. DateExample
    In this section we are discussing about the specific date using the Date class object, retrieving milliseconds from the Date object, elapsed time, date contained in the Date object before and after it has change and displaying both the values on the console.
       
  122. DateForms
    In this section we are demonstrating the retrieval of date from the Date object in various forms.In the following code segment we are performing various operations on Date object
      
  123. MonthCalender
    In this section we are displaying the days of  a specific month and the calendar format of the days for this month. We are also checking whether the year is leap or not.
      
  124. Auto Increment and Decrement
    In this example we are demonstrating the significance of prefix and postfix operators by incrementing and decrementing the value of a variable that how both are different with each other. 
     
  125. Randomizer
    In this example we are discussing how to generate the random numbers by using the random() method of the Math class and change them into different random numbers by apply some mathematical operations onto them and display 10 random numbers on the console.
  126. Reverse String 
    In this example we are demonstrating the command line argument and displaying it in its backward direction on the console.
      
  127. Garbage Collection  
    In the example we are describing how the garbage collector works.
     
      
       
  128. Check Empty String
    In this example we are checking a sting object containing empty or null value. Apache has provided two methods isBlank() and isNotBlank() for checking the strings..
     
  129. Access Static Member Of The Class Through Object
    Static methods are special type of methods that work without any object of the class. Static methods are limited to calling other static methods in the class and to using only static variables.

  130. Command Line Arguments in Java Program
    Java application can accept any number of arguments directly from the command line. The user can enter command-line arguments when invoking the application. 

  131. Read a string and reverse it and then print in alphabetical order.
    A string is a contiguous sequence of symbols or values, such as a character string (a sequence of characters) or a binary digit string (a sequence of binary values).

  132. Array to Collection
    List  interface is a member of the Java Collection Framework and extends Collection interface. List interface is an ordered collection which follows insertion order, typically allow duplicate elements. The List interface provides a special iterator, called ListIterator for insertion, replacement and  bi-directional access. 
     
  133. Copy a file to other destination and show the modification time of destination file
    This is detailed java code that copies a source file to destination file, this code checks all the condition before copy to destination file, for example- source file is exist or not, source file is readable or not etc.
        
  134. Java Arrays Tutorial
    Java Arrays Tutorials and examples .

  135. Java String Split Example  
    In this section, you will learn how to split string into different parts using spit() function.

Back to Java Tutorials Page
 

Advertisement

Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: January 22, 2008

Ask Questions?    Discuss: Beginners Java Tutorial   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
vishal
April 2, 2011
java

sir, i hava a lot of problem in java i hava a lot of question in java i hava to need the answer of that question please help me. vishal kumar
sara
April 17, 2011
java programing

Do you really need to have a main method in every class?
mulualem
April 21, 2011
java 1

These so interesting course.

June 10, 2011


Anil Arya
June 16, 2011
Java biggener

It ,s describe very good.
AMK
July 2, 2011
downloadable version?

hello, i really appreciate the work you have done, but just had a recommendation.. please try and put up a pdf version of this... hope to hear from you soon, email me at: abdulmusawwir_786@hotmail.com thnx!!
Buff
July 3, 2011
mqwTmaeMoQtwnyhWMq

So true. Honesty and everything regcionzed.
ASHISH KUMAR SHARMA
July 29, 2011
THANKSSSSSSSSSSS

THIS IS THE BEST SITE FOR BEGINNER EVERY CONCEPT IS CLEAR AND EASY TO LEARN >........ CAN U PROVIDE SOME PROJECTS IN CORE JAVA ONLY CODING CAN BE SUFFICIENT
Bilal Ahmad
August 17, 2011
java

why we need java for advance programing?
ramesh
August 28, 2011
java

FYI
AMAR SINGH SAINI
September 9, 2011
begining

It is nice attempt on-line , i saw till now in Java programming...........thanks to organisers
alex
September 19, 2011
java examples

nice
sunny kumar
October 8, 2011
java

good beginning 4 beginners
sathish
October 19, 2011
java learning

hello sir, i am sathish.i wish to learn java programming but i don't know about basic programming language(c,c++).but i like java language.i can learn for java programming please help me.reply my email id.sathishk969@gmail.com
SONJOY DARIPA
October 20, 2011
java

it's a very good site for bigener.
AMIT KUMAR SHUKLA
November 14, 2011
java

tutorial
Balan
November 19, 2011
Java basic

How to learn Java programme quikly
inteshar hussain
November 21, 2011
computer Science

About the java and java cods
Markutori
November 30, 2011
http://www.infopeer.com

Helpful tutorials for any java beginner
umar muktahr
December 19, 2011
java

sub:please explain about garbage collection
ayushi
January 12, 2012
how to load mysql driver.

hllo.... their is a prblm when am accessing a command on command prompt. it showing a exception here it is..... java.sql.SqlException:no suitable driver found for jdbd:mysql:3306/mysql plz tell me hw to load a driver.
Siddharth Srivastava
January 16, 2012
Java programs

Java program to convert $into Rs
Wendy
January 25, 2012
opinion

It was alil bit helpful bt i tot it was meant 2 explain give examples of everytin n nt just shine a very lil light on dem. So m nt rili satisfied wit dis
vipul thawre
January 29, 2012
simple calc in java swing

import java.awt.*; import javax.swing.*; import java.awt.event.*; /* SAVE AS CalcDemo.java*/ class CalcDemo extends JFrame implements ActionListener { JButton ad,sub,mul,div,sqr,re,me,ex; JTextField t1,t2,t3; JLabel l1,l2,l3; JPanel p; JFrame f; public CalcDemo() { JFrame f=new JFrame("Simple Calc BY VIPUL THAWRE"); f.setResizable( false ); //setLayout(new GridLayout(10,2)); ad=new JButton("Addition"); p=new JPanel(); sub=new JButton("Substraction"); mul=new JButton("Multiplication"); re=new JButton("Refresh"); ex=new JButton("EXIT"); me=new JButton("Click here for developer message"); div=new JButton("Division"); l1=new JLabel("first no"); l2=new JLabel("Second no"); l3=new JLabel("Result"); t1=new JTextField(20); t2=new JTextField(20); t3=new JTextField(20); f.add(p); p.add(l1); p.add(t1); p.add(l2); p.add(t2); p.add(l3); p.add(t3); p.add(ad); p.add(sub); p.add(mul); p.add(div); p.add(re); p.add(me); p.add(ex); ad.addActionListener(this); sub.addActionListener(this); mul.addActionListener(this); div.addActionListener(this); re.addActionListener(this); me.addActionListener(this); ex.addActionListener(this); f. setVisible(true); f.setSize(300,300); } public void actionPerformed(ActionEvent ae) { if(ae.getSource()==ad) { int x=Integer.parseInt(t1.getText()); int y=Integer.parseInt(t2.getText()); int z=x+y; t3.setText(Integer.toString(z)); }else if(ae.getSource()==sub) { int x=Integer.parseInt(t1.getText()); int y=Integer.parseInt(t2.getText()); int z=x-y; t3.setText(Integer.toString(z)); }else if(ae.getSource()==mul) { int x=Integer.parseInt(t1.getText()); int y=Integer.parseInt(t2.getText()); int z=x*y; t3.setText(Integer.toString(z)); }else if(ae.getSource()==div) { int x=Integer.parseInt(t1.getText()); int y=Integer.parseInt(t2.getText()); int z=x/y; t3.setText(Integer.toString(z)); }else if(ae.getSource()==re) { t1.setText(null); t2.setText(null); t3.setText(null); }else if(ae.getSource()==me) { JOptionPane.showMessageDialog(f,"Develop By VIPUL THAWRE....from SHRI DATTA MEGHE POLYTEHNIC,NAGPUR"); }else if(ae.getSource()==ex) { System.exit(1); } } public static void main(String a[]) { CalcDemo c=new CalcDemo(); } }
Amit diwakar
January 29, 2012
nice

wow.! that's great..!
chandru
February 9, 2012
java biginers

i want to learn java
Shivam Aggarwal
February 12, 2012
Fun and Practice Java Programs For Beginners

beginnersjavaprograms.blogspot.in There are Java programs for beginners, including console based fungames(cross and noughts), recursive functions(only basic), number-names programs, etc, completely bases on core, basic Java concepts. Please do visit and like/comment.
Ravi
February 23, 2012
question

What is the difference between java language and java script?
Chukucha Isheanesu
March 5, 2012
learning Java

wish to be an expert in java in due course. as a beginner I would appreciate every tutorial that you will send me
haisam
March 15, 2012
sarting computer scince i.t for beginner

heloo, i m student of first year and i want to start computer scince or i.t short courses onlin. so what i have to do in beginning? what i have to learn first? i need to learn the basic things. it is very essential and important for me and i need it so plz help me thnks........
ravi
March 18, 2012
java

hi
dhakshinamoorthy
April 4, 2012
java

very nice tutorial for the beginners. i wish to continue the job. all the best.
siddu
April 17, 2012
java

hi my name is siddu java tutorial is excellent one its enough to learn java.
Gopal Mali
April 28, 2012
I want to learn Java

Hello I want to learn java
Nikhil Gupta
May 11, 2012
JAVA TUTORIALS

on this site here is everything i looking for, one who don't have knowledge about java and programming language here is the key to get learn in simple language. thanks all to all who can build these tutorials. Regards, Nikhil Gupta
Rules Breaker
May 16, 2012
java to c++ converter

hello friends .. is there any tool except RULES BREAKER (myself) that can concert java code to c++ code ? i mean taht can convert automatically java to c++. thanks
delmin
May 26, 2012
java

gooood notes for beginners...............thank you
ganga
June 21, 2012
java

how to use java backend
pazhani MCA
July 14, 2012
i want some technologies in java

more java programs to send my mail plz help me
VJ-vijay
July 26, 2012
java

Heartfull thanks to u guys :-)
Amarkantvats
July 27, 2012
java tutorials

sir, please send me java tutorial for taking interviews.all questions should be based on java interview.
punith
August 10, 2012
core java , packages, interface ,

more examples on using above topics
Sudi
August 12, 2012
About above points

Thank u for this one... really it helped me...
vasunder
August 31, 2012
java

hello i want to learn java i m a beginer if u upload a videos of class of java so that it can be easily understand by us .i will thankful to u .
Sonia
September 9, 2012
feedback

Awsm
sathishkumar.R
October 8, 2012
java program

K.S.R college of engineering.
zaki saifi
October 15, 2012
java

java is very interesting language. if u r interested in JAVA.
Hossen Chowdhury
April 5, 2013
For Thanks

This is my first time to post anything online. I never expend my time to post anything to any website. But when I have visited your website I donâ??t know why I feel to write something about on your website. I have found why I have posted on your site. The reason of post on your site is RESPECT of your work and I feel more comport on java after I have visited your web site. I would like to take online pre-recorded class after couple of months later. Could you please inform me what are the cost for JAVA tutorial. I am looking forward to hearing from you. Best Regards, Mohammad Chowdhury
santosh sahani
April 28, 2013
java

i want perfect in the java programming language
MR.Zeeshan
May 2, 2013
java

like all tutorials .
java warm
September 6, 2013
is good and like me

java been very very good to me i want learn java online today yu no java learn not want
anthony michael
June 23, 2012
starting the programme

this whole programme is a very good oone and i want to start my online tommorrow if possible
DMCA.com