0% found this document useful (0 votes)
162 views

Skill

The document contains instructions for 14 Java programming problems or exercises including: 1) Reading student details from a file and copying to another file. 2) Using various String class methods like indexOf(), substring(), etc. 3) Validating and calculating the perimeter of a triangle based on edge lengths. 4) Checking if a number is divisible by 3 and 7. 5) Creating classes with setter methods. 6) Overloading methods to calculate areas of circles and squares. 7) Printing different data types using the same method name. 8) Creating an array of object references to print account details.

Uploaded by

anand chowdary
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
162 views

Skill

The document contains instructions for 14 Java programming problems or exercises including: 1) Reading student details from a file and copying to another file. 2) Using various String class methods like indexOf(), substring(), etc. 3) Validating and calculating the perimeter of a triangle based on edge lengths. 4) Checking if a number is divisible by 3 and 7. 5) Creating classes with setter methods. 6) Overloading methods to calculate areas of circles and squares. 7) Printing different data types using the same method name. 8) Creating an array of object references to print account details.

Uploaded by

anand chowdary
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

1) Write a Java Program to read details of 10 students from file and copy them to the other.

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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy