Sie sind auf Seite 1von 3

1) Write a java program to read a string and to count total number of words in that string.[EXAM1.

JAVA] 2) Create a package called salary. Under the package create 2 classes called income and expenditure .the income class contains(salary,allowance ,rent) and the other one contains (food,clothing,educational) expenses.create a budget class which use the above classes and also calculate savings of the family. 3) Write a java program to create a file from an already existing file which stores only odd numbers in it from the existing file. [COPYFILE.JAVA] 4) Write a program which has a method called sequeze(string s,int m,int n) which removes n characters starting from mposition.also write a method to reverse the string. 5) Write a program to accept a string from the user,print the number of occurances of all the alphabets present in it.[occu.java] 6) Write a program to accept file name as command line argument ,if not passed call an exception otherwise print the contents from the file. 7) WAP TO accept names from the user and print it in the following form: Input: Arvind S Patel Output:A.S.Patel 8) WAP that prints the details of products from product of file. 9) WAP which accepts two file name as argument,if the argument is not given,call the exception otherwise appearead second file to first. 10)WAP which accepts a string from the user. Reverse the words in it. 11)WAP to generate an exception when we enter negative number.(2) 12)WAP to determine whether the object created is string object or not. 13)WAP to accept a string print the uppercase to lower case and vice versa. e.g input- I am a Girl output-i AM A Girl

14)WAP that executes three threads from one thread class.one thread displays java for every one second .second displays c for every 2 seconds ,third thread displays c++ every 3 seconds. 15)WAP which accepts a number through command line argument.if passed value is not a number throw on exception. 16)WAP which will read a string and rewrite it in alphabetical order. e.g the word COMPUTER should be written as CEMOPRTU 17)WAP that pass command line arguments of name of the different students. Arrange them in name wise increasing order. 18)Write an application that creates and starts three threads. Each thread is instantiated from the same class .it executes a loop with ten iterations .each iteration displays the character A and sleep between 300 to 500 milliseconds .the application waits for all threads to complete and then displays a message. 19)WAP to pass number through command line argument and check whether inputted number is Armstrong or not Armstrong. 20)WAP that generates a custom exception if any of its command line arguments are floating point number. 21)WAP that accepts 5 command line arguments and raise the custom exception if any argument is nor from the list (BCA,MCA,BBA,MBA,OTHER)(2) 22)Define an exception called No Match that is thrown when a string is not equal to college,WAP that uses this exception. 23)WAP to implement stack application using Thread.(2) 24)WAP to simulate DIGITAL clock using Thread.(2) 25) Develop a java program to find all rotation of a string given at command line. All conditions should be checked.e.g Test o/p:Test,estT,stTe,tTes. 26) WAP that generates ArrayIndexOutOfBoundsException,catch the exception & display an error message. 27) The abstract class has two subclasses named JETAIR1 & JETAIR2.each airplane can transport a different number of passenegers.each airplane object has unique serial number.write an application that declares this class hierarchy.instantiate several types of airplanes & display them.override toString() method of object to return a string with the type.serial number & capacity. 28)

Das könnte Ihnen auch gefallen