Vous êtes sur la page 1sur 3

This section has Java programs for learning purpose.

and solving lab

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 errors are 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) javac HelloWorld.java Executing java programs Executing java program interprets the byte code created eg. Running a HelloWorld program java HelloWorld Java programs list java java java java java java java java java java java java java java java java program program program program program program program program program program program program program program program program to to to to to to to to to to to to to to to to add two numbers check a number is armstrong or not check prime numbers below range check a number is prime or not find a string is palindrome or not connect to mysql database connect to oracle database count characters, words lines in a string copy one file into another find factorial of a number find fibonacci series find palindrome of a number find roots of quadriatic equation find simple interest implement stack list files in a directory

java program to multiply two matrices java program to print pascals triangle java program to read a file java program to read a file line by line java program to reverse a given number java program to show arithmetic operations java program to show current current date and time java program to show maximum of two numbers java program to sort list of strings java 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 . java program to show constructor overloading. java program to compare two stack variables java program to show private member of superclass java program to show inheritance java program to show polymorphism java program to calculate charges of various trunk calls using polymorphism java program to import package and access method in it Java to show the usefulness of Interfaces as a place to keep constant value of t he program. java program to show method overriding java program to show implementation of interface.java program to show Array inde x out of bound Exception Java program to show divide by zero exception. java program to throw number format exception java program to avoid vehicle collision of vechicle coming in opposite direction java program to show thread priority java program to launch multiple threads and count them. java program to generate 2 threads, one for printing even numbers and the other for printing odd numbers. java program to show thread synchronisation. java 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 resultan t string in upper case. iii) Reads a string from console and appends it to the resultant string of ii. java 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 ag ain print on console. java 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. java applet to read text and display length in textbox use colors java applet which displays a rectangle/string with specified colour & coordinate passed as parameter from the HTML file. java applet which will display the calendar of a given date. java program to displaystudent s detail using Card Layout java applet to add scrollbars to textarea and find a word in a text. Java program to find the numeric address of web sites java applet to accept name age and display message and url javaprogram to test Socket functionality for appropriate hostname and port numbe r. Java program to connect to a database and perform operations of Selection, Inser

tion and Deletion on the database.

Vous aimerez peut-être aussi