Skip to content

teztripathy/TopGear-L3-Java-Asgmt2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TopGear-Core-Java-Assignment002 - by Tejeswar Tripathy

Core Java Eclipse Project

  1. Create an ArrayList of Employee( id,name,address,sal) objects and retrieve objects from ArrayList by using forEach() method of Iterable interface.

  2. Create two interfaces Piano & Guitar with single default method void play() with different implementations. Add single implementation class Instrument for both the interfaces. Solve method name ambiguity in Instrument class by using two different approaches.

  3. Create an interface WordCount with single abstract method int count(String str) to count no.of words in a given string. Implement count(String str) method by using Lambda expression in an implementation class MyClassWithLambda & invoke it to display the result on the console.

  4. Add following Ideas to Assignment 1

    i. Along with getters & setters add a static method static int compareBySal(Employee e1,Employee e2) to compare employee based onsalary.

    ii. Use Collections.sort (-,-) method to compare employee objects of Array List.

    iii. Invoke compareBySal() method by using Method Reference and pass it as second argument to the sort() method.

  5. Write a java class to find the date of next month second Sunday by using java time API.

  6. Write a java class to calculate your experience (no.of years, no.of months &no.of days) in Wipro by using java time API.

  7. Create a java class to

    i. Create a list of string objects

    ii. Count no.strings whose length is> 5

    iii. Count no.of empty strings

    iv. Find out empty strings & store them into new list by using Stream API.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages