Find PDF
Find PDF
Find PDF
2) Write Java programs to illustrate the usage of the following String Class methods -Searching
Strings – indexOf(), lastIndexOf(), isEmpty() Modifying Strings – substring(), concat(), replace(),
trim(), toUpperCase(), toLowerCase().
3) Write a program that reads three edges for a triangle and computes the perimeter if the input is
valid otherwise display the input is invalid. The input is valid if the sum of every pair of two
edges greater than remaining edge
4) Modularize the following problem to package level .Write a java code to take an integer n( hard
code) and check whether n is divisible by both 3 and 7or by neither of them or by just one of
them.
5) Write a java program, by defining only the setter method to set the values of the variable.
6) Crate a class MethodOverload which includes two overload versions of method area() .one that
calculates the area of circle by taking radius as an argument and another which computes the
area of square.
7) Create a class named 'PrintNumber' to print various numbers of different datatypes by creating
different methods with the same name 'printn' having a parameter for each datatype.
8) Create an array of object references to a class BankDetails. The class has one method
accDetails() which takes account number as input and prints all details of a customers.
9) Develop a java program to create a Class Vehicle with wheels and color as it member. Now
create parameterized and no parameterized constructors that assign values to Vehicle class
members with appropriate display messages.
10) Create a class named 'Rectangle' with two data members- length and breadth and a method to
claculate the area which is 'length*breadth'. The class has three constructors which are : a -
having no parameter - values of both length and breadth are assigned zero.
11) A palindromic prime is a prime number and also palindromic. For example, 131 is a prime and
also a palindromic prime, as are 313 and 757. Write a program that displays the first 100
palindromic prime numbers. Display 10 numbers per line, separated by exactly one space, as
follows: 2 3 5 7 11 101 131 151 181 191 313 353 373 383 727 757 787 797 919 929.
12) Write a java program to fine sum of elements in an array using command line arguments.
13) A)Write a java program to find maximum and minimum number from given three static
numbers using conditional operator. b) Write a java program to print the prime number in the
given range.
14) Create a class named 'JProgram'. While creating an object of the class, if nothing is passed to it,
then the message "I love programming languages" should be printed. If some String is passed to
it, then in place of "programming languages" the name of that String variable should be
printed.For example, while creating object if we pass "Java", then "I love Java" should be
printed.