Core Java Tasks
Core Java Tasks
3. Get the two months before date from the given date.
a. i/p : 10-17-2019 o/p : 8-17-2019
4. Write a program to read the data from 2 files and write into another file with
unique records and also print the each record no of occurrence.
5. Write a program to find the number of .java files from the given folder and
get the number of lines from each file which excludes packages, import
statement, comments
https://www.mkyong.com/java/how-to-find-files-with-certain-extension-only/
6. Customer.txt
CustId Name CardNo DOB Balance EmailId
Requirements:
1. If card number starts with 8 American express
2. If card number starts with 6 amex
3. If card number starts with 5 visa
4. If card number starts with 4 master card
Other than 4, 5, 6, 8 consider as invalid card number
Q) Get the count of each card type and their details
Hint: Map <String, Map <String, Object>>
<”Amex”, <6, List<customer details>>>
<”visa”, <5, List<customer details>>>
Q) Who is the customer have highest bal and 5th highest?
Q) Write a program to read the customer.txt file from remote server and perform the below
operations:
1. Get the list of customer details whose balance is greater than 50000 and write the result
data into customer-rtp4811.txt file which will be stored in the remote system
Steps to implementation:
1. Write a java program to connect remote server using ip-address, uname, pwd
2. Convert file data into java object (domain object)
Public class Customer {
Public String name;
Public String cardNo;
Public String dob; …..
}
3. Write business logic if customer.getBalance is greater than 50000 then store the data
into file customer-rtp4811.txt
7. Remove the duplicates from the arraylist without using predefined methods
[don’t use set related classes]
8. Revers of given string without using predefined methods
9. Date: dd-mm-yyyy HH:MM:ss IST convert this date into all the countries
format date
Input: 07-12-2019 5:37 PM IND
Output: 07-12-2019 4:00 AM US
10. How arraylist add () and addAll () method internally works?
11. How arraylist put () method internally works?