Upload
ganeshkrishna
View
224
Download
0
Embed Size (px)
Citation preview
7/31/2019 Java Programs - Www.itstudentjunction
1/4
java programs
Starting java program - hello world
classHelloWorld {
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
Saving java programs
Every java program should be saved as name of java class
example the above program should be saved as HelloWorld.java
Compiling java programs
Compliling java programs check the program for syntax errors and once no errorsare detected, byte code is created as a class file . 'javac ' command is used to
compile java programs
eg. for compling HelloWorld program (in command prompt)
avac HelloWorld.java
Executing java programs
Executing java program interprets the byte code created
eg. Running a HelloWorld program
ava HelloWorld
Java programs list
7/31/2019 Java Programs - Www.itstudentjunction
2/4
ava program to add two numbers
ava program to check a number is armstrong or not
ava program to check prime numbers below range
ava program to check a number is prime or not
ava program to find a string is palindrome or not ava program to connect to mysql database
ava program to connect to oracle database
ava program to count characters, words lines in a string
ava program to copy one file into another
ava program to find factorial of a number
ava program to find fibonacci series
ava program to find palindrome of a number
ava program to find roots of quadriatic equation
ava program to find simple interest
ava program to implement stack
ava program to list files in a directoryava program to multiply two matrices
ava program to print pascals triangle
ava program to read a file
ava program to read a file line by line
ava program to reverse a given number
ava program to show arithmetic operations
ava program to show current current date and time
ava program to show maximum of two numbers
ava program to sort list of strings
ava program to find area of rectangle
Java program to show example of arthemetic, logic & relational operations
Java program to explain break and continue statements.
Java program to find average marks
Java program to find multiplication of matrices
Java program to find sum of digits of integer
Java program to create objects of a class .
ava program to show constructor overloading.
ava program to compare two stack variables
ava program to show private member of superclass
ava program to show inheritance
ava program to show polymorphism
ava program to calculate charges of various trunk calls using polymorphism
ava program to import package and access method in it
Java to show the usefulness of Interfaces as a place to keep constant value of the
program.
ava program to show method overriding
ava program to show implementation of interface.java program to show Array
index out of bound Exception
Java program to show divide by zero exception.
http://www.itstudentjunction.com/java-programs/java-program-to-add-two-numbers.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-add-two-numbers.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-check-a-number-is-armstrong-or-not.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-check-a-number-is-armstrong-or-not.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-check-a-number-is-prime-numbers-below-range.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-check-a-number-is-prime-numbers-below-range.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-check-a-number-is-prime-or-not.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-check-a-number-is-prime-or-not.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-check-a-string-is-palindrome-or-not.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-check-a-string-is-palindrome-or-not.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-connect-to-mysql-database.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-connect-to-oracle-database.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-connect-to-oracle-database.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-count-no-of-characters-words-lines-in-a-given-string.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-count-no-of-characters-words-lines-in-a-given-string.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-copy-one-file-into-another-file.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-copy-one-file-into-another-file.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-find-factorial-of-a-number.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-find-factorial-of-a-number.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-find-fibonacci-series.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-find-fibonacci-series.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-find-palindrome-of-a-number.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-find-palindrome-of-a-number.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-find-roots-of-quadriatic-equation.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-find-roots-of-quadriatic-equation.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-find-simple-interest.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-find-simple-interest.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-implement-stack.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-implement-stack.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-list-files-in-directory.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-list-files-in-directory.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-list-files-in-directory.htmhttp://www.itstudentjunction.com/java-programs/java-programs/more%20programs%202/java-program-to-print-pascal-triangle.htmhttp://www.itstudentjunction.com/java-programs/java-programs/more%20programs%202/java-program-to-print-pascal-triangle.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-read-a-file.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-read-a-file.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-read-a-file-line-by-line.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-read-a-file-line-by-line.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-reverse-a-given-number.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-reverse-a-given-number.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-arithemetic-operations.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-arithemetic-operations.htmhttp://www.itstudentjunction.com/java-programs/java-programs/more%20programs%202/java-program-to-show-current-date-and-time.htmhttp://www.itstudentjunction.com/java-programs/java-programs/more%20programs%202/java-program-to-show-current-date-and-time.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-maximum-of-two-numbers.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-maximum-of-two-numbers.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-sort-list-of-strings-names.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-handle-ArrayIndexOutOfBoundsException.htmhttp://www.itstudentjunction.com/java-programs/arthemetic-logic-relational-operations-java-program.htmhttp://www.itstudentjunction.com/java-programs/java-program-explain-break-continue.htmhttp://www.itstudentjunction.com/java-programs/java-program-explain-break-continue.htmhttp://www.itstudentjunction.com/java-programs/java-program-find-average-marks.htmhttp://www.itstudentjunction.com/java-programs/java-program-find-average-marks.htmhttp://www.itstudentjunction.com/java-programs/java-program-find-mutiplication-of-matrices.htmhttp://www.itstudentjunction.com/java-programs/java-program-find-sum-of-digits-of-integer.htmhttp://www.itstudentjunction.com/java-programs/java-program-find-sum-of-digits-of-integer.htmhttp://www.itstudentjunction.com/java-programs/java-program-rectangle-class.htmhttp://www.itstudentjunction.com/java-programs/java-program-rectangle-class.htmhttp://www.itstudentjunction.com/java-programs/java-program-show-constructor-overlading.htmhttp://www.itstudentjunction.com/java-programs/java-program-show-constructor-overlading.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-compare-two-variable-stacks.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-compare-two-variable-stacks.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-private-member-of-superclass.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-private-member-of-superclass.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-inheritance.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-inheritance.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-polymorphism.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-polymorphism.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-calculate-charges-various-trunk-calls-using-polymorphism.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-calculate-charges-various-trunk-calls-using-polymorphism.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-import-a-package-to-access-method-in-it.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-import-a-package-to-access-method-in-it.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-usefulness-of-interfaces-to-keep-constant.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-usefulness-of-interfaces-to-keep-constant.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-usefulness-of-interfaces-to-keep-constant.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-mehod-overriding.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-mehod-overriding.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-implementation-of-interface.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-implementation-of-interface.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-handle-Divide-by-zero-exception.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-handle-Divide-by-zero-exception.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-handle-Divide-by-zero-exception.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-implementation-of-interface.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-implementation-of-interface.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-mehod-overriding.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-usefulness-of-interfaces-to-keep-constant.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-usefulness-of-interfaces-to-keep-constant.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-import-a-package-to-access-method-in-it.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-calculate-charges-various-trunk-calls-using-polymorphism.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-polymorphism.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-inheritance.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-private-member-of-superclass.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-compare-two-variable-stacks.htmhttp://www.itstudentjunction.com/java-programs/java-program-show-constructor-overlading.htmhttp://www.itstudentjunction.com/java-programs/java-program-rectangle-class.htmhttp://www.itstudentjunction.com/java-programs/java-program-find-sum-of-digits-of-integer.htmhttp://www.itstudentjunction.com/java-programs/java-program-find-mutiplication-of-matrices.htmhttp://www.itstudentjunction.com/java-programs/java-program-find-average-marks.htmhttp://www.itstudentjunction.com/java-programs/java-program-explain-break-continue.htmhttp://www.itstudentjunction.com/java-programs/arthemetic-logic-relational-operations-java-program.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-handle-ArrayIndexOutOfBoundsException.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-sort-list-of-strings-names.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-maximum-of-two-numbers.htmhttp://www.itstudentjunction.com/java-programs/java-programs/more%20programs%202/java-program-to-show-current-date-and-time.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-arithemetic-operations.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-reverse-a-given-number.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-read-a-file-line-by-line.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-read-a-file.htmhttp://www.itstudentjunction.com/java-programs/java-programs/more%20programs%202/java-program-to-print-pascal-triangle.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-list-files-in-directory.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-list-files-in-directory.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-implement-stack.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-find-simple-interest.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-find-roots-of-quadriatic-equation.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-find-palindrome-of-a-number.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-find-fibonacci-series.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-find-factorial-of-a-number.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-copy-one-file-into-another-file.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-count-no-of-characters-words-lines-in-a-given-string.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-connect-to-oracle-database.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-connect-to-mysql-database.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-check-a-string-is-palindrome-or-not.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-check-a-number-is-prime-or-not.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-check-a-number-is-prime-numbers-below-range.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-check-a-number-is-armstrong-or-not.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-add-two-numbers.htm7/31/2019 Java Programs - Www.itstudentjunction
3/4
ava program to throw number format exception
ava program to avoid vehicle collision of vechicle coming in opposite direction
ava program to show thread priority
ava program to launch multiple threads and count them.
ava program to generate 2 threads, one for printing even numbers and the other
for printing odd numbers.ava program to show thread synchronisation.
ava program to read text and display length in textbox
Write a program in Java for String handling which performs the following:
i) Checks the capacity of StringBuffer objects.
ii) Reverses the contents of a string given on console and converts the resultant
string in upper case.
iii) Reads a string from console and appends it to the resultant string of ii.
ava program to find first and last occurance of char substring in a string
Java program to read a statement from console, convert it into upper case and
again print on console.ava program which takes the name of a file from user, read the contents of the file
and display it on the console
Java program to copy a file into another file.
ava applet to read text and display length in textbox use colors
ava applet which displays a rectangle/string with specified colour & coordinate
passed as parameter from the HTML file.
ava applet which will display the calendar of a given date.
java program to displaystudents detail using Card Layout
ava applet to add scrollbars to textarea and find a word in a text.
Java program to find the numeric address of web sites
ava applet to accept name age and display message and url
avaprogram to test Socket functionality for appropriate hostname and port
number.
Java program to connect to a database and perform operations of Selection,
Insertion and Deletion on the database.
http://www.itstudentjunction.com/java-programs/java-program-to-throw-number-Format-Exception.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-throw-number-Format-Exception.htmhttp://www.itstudentjunction.com/java-programs/java-program-avoid-vehicle-collision.htmhttp://www.itstudentjunction.com/java-programs/java-program-avoid-vehicle-collision.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-multithreading-with-priority.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-multithreading-with-priority.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-launch-multiple-threads-and-count-them.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-launch-multiple-threads-and-count-them.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-generate-two-threads-one-for-counting-even-numbers-other-for-odd-numbers.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-generate-two-threads-one-for-counting-even-numbers-other-for-odd-numbers.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-generate-two-threads-one-for-counting-even-numbers-other-for-odd-numbers.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-thread-syncronization.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-thread-syncronization.htmhttp://www.itstudentjunction.com/java-programs/java-applet-to-read-text-and-display-length-in-textbox.htmhttp://www.itstudentjunction.com/java-programs/java-applet-to-read-text-and-display-length-in-textbox.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-perform-sting-handling.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-perform-sting-handling.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-find-first-last-occurance-of-char-substring-in-a-string.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-find-first-last-occurance-of-char-substring-in-a-string.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-convert-a-string-to-uppercase-and-print-on-console.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-convert-a-string-to-uppercase-and-print-on-console.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-convert-a-string-to-uppercase-and-print-on-console.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-take-file-name-from-console-and-display-the-contents-on-console.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-take-file-name-from-console-and-display-the-contents-on-console.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-copy-a-file-to-another-file.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-copy-a-file-to-another-file.htmhttp://www.itstudentjunction.com/java-programs/java-applet-to-read-text-and-display-length-in-textbox.htmhttp://www.itstudentjunction.com/java-programs/java-applet-to-display-a-rectangle-or-string-in-specified-color.htmhttp://www.itstudentjunction.com/java-programs/java-applet-to-display-a-rectangle-or-string-in-specified-color.htmhttp://www.itstudentjunction.com/java-programs/java-applet-to-display-a-rectangle-or-string-in-specified-color.htmhttp://www.itstudentjunction.com/java-programs/java-applet-to-read-text-and-display-calander-of-a-given-date.htmhttp://www.itstudentjunction.com/java-programs/java-applet-to-read-text-and-display-calander-of-a-given-date.htmhttp://www.itstudentjunction.com/java-program-to-display-student-details-in-card-layout.htmhttp://www.itstudentjunction.com/java-program-to-display-student-details-in-card-layout.htmhttp://www.itstudentjunction.com/java-programs/java-applet-to-add-scollbars-to-textarea-and-find-word-in-text.htmhttp://www.itstudentjunction.com/java-programs/java-applet-to-add-scollbars-to-textarea-and-find-word-in-text.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-find-network-address.htmhttp://www.itstudentjunction.com/java-programs/java-applet-to-accept-name-age-and-display-message-and-url.htmhttp://www.itstudentjunction.com/java-programs/java-applet-to-accept-name-age-and-display-message-and-url.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-test-socket-functionality-for-hostname-port-number.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-test-socket-functionality-for-hostname-port-number.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-test-socket-functionality-for-hostname-port-number.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-connect-to-database-and-perform-selection-insertion-deletion.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-connect-to-database-and-perform-selection-insertion-deletion.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-connect-to-database-and-perform-selection-insertion-deletion.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-connect-to-database-and-perform-selection-insertion-deletion.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-test-socket-functionality-for-hostname-port-number.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-test-socket-functionality-for-hostname-port-number.htmhttp://www.itstudentjunction.com/java-programs/java-applet-to-accept-name-age-and-display-message-and-url.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-find-network-address.htmhttp://www.itstudentjunction.com/java-programs/java-applet-to-add-scollbars-to-textarea-and-find-word-in-text.htmhttp://www.itstudentjunction.com/java-program-to-display-student-details-in-card-layout.htmhttp://www.itstudentjunction.com/java-programs/java-applet-to-read-text-and-display-calander-of-a-given-date.htmhttp://www.itstudentjunction.com/java-programs/java-applet-to-display-a-rectangle-or-string-in-specified-color.htmhttp://www.itstudentjunction.com/java-programs/java-applet-to-display-a-rectangle-or-string-in-specified-color.htmhttp://www.itstudentjunction.com/java-programs/java-applet-to-read-text-and-display-length-in-textbox.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-copy-a-file-to-another-file.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-take-file-name-from-console-and-display-the-contents-on-console.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-take-file-name-from-console-and-display-the-contents-on-console.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-convert-a-string-to-uppercase-and-print-on-console.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-convert-a-string-to-uppercase-and-print-on-console.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-find-first-last-occurance-of-char-substring-in-a-string.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-perform-sting-handling.htmhttp://www.itstudentjunction.com/java-programs/java-applet-to-read-text-and-display-length-in-textbox.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-thread-syncronization.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-generate-two-threads-one-for-counting-even-numbers-other-for-odd-numbers.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-generate-two-threads-one-for-counting-even-numbers-other-for-odd-numbers.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-launch-multiple-threads-and-count-them.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-show-multithreading-with-priority.htmhttp://www.itstudentjunction.com/java-programs/java-program-avoid-vehicle-collision.htmhttp://www.itstudentjunction.com/java-programs/java-program-to-throw-number-Format-Exception.htm7/31/2019 Java Programs - Www.itstudentjunction
4/4