0% found this document useful (0 votes)
16 views4 pages

Core Java Tasks

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views4 pages

Core Java Tasks

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Contents

1. String name = “sreenu technologies for java real time projects”......................................2


2. Write a program to apply the sorting on dates, amount, description................................2
3. Get the two months before date from the given date......................................................2
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..........................................................2
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..........2
6. Customer.txt....................................................................................................................2
Requirements:.....................................................................................................................3
Q) Get the count of each card type and their details........................................................3
Q) Who is the customer have highest bal and 5th highest?................................................3
Q) Write a program to read the customer.txt file from remote server and perform the
below operations:............................................................................................................3
Core Java
1. String name = “sreenu technologies for java real time projects”.
O/p
a. No of words = 6
b. No of occurrence of each character of given string
c. Map map = new HashMap();
d. map.put(“e”,7);
e. Reverse the given string without using predefined methods like reverse

2. Write a program to apply the sorting on dates, amount, description.


a. List of dates  o/p : ascending order
b. List of amount  o/p : ascending order
c. List of description  o/p : ascending order

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

111111 Tharun 5211140058239 2-4-1991 880,00,000 [email protected]

222222 Maruthi 3211140058239 1-10-1993 60,00,000 [email protected]


333333 Sandeep 6211140058239 24-8-1992 240,00,000 [email protected]

444444 Shiva 2211140058239 6-12-1990 80,00,000 [email protected]

555555 Shravani 8211140058239 17-3-1995 950,00,000 [email protected]

666666 VMSR 4211140058239 11-5-1990 1000,00,000 [email protected]

Upto 100 -------------- ---------------- ---------------- ---------------- ----------------------------------

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?

You might also like