See this article for code covering those cases), we use a simple regex-based CSV parser. In this program, we have gathered the count of employees but rather than this, we can get the list of Employees. In an illustration of a simple usage of groupingBy(), we show how to group the data by year. What Are Microservices Architecture and How Do They Work? The getters and setters are left out to make it more readable. Xavier is a software developer working in a consulting firm based in Barcelona. We have shown a couple of strategies to do complex multi-field groupings with aggregations that include non-primitive data types with multi and cross-field calculations. By nesting collectors, we can add different layers of groups to implement multi level groupings. The result is a map of year and players list grouped by the year. to get away from possible un-intentional duplicates because of String concat, you could use: Thanks for contributing an answer to Stack Overflow! accumulo,1,ActiveMQ,2,Adsense,1,API,37,ArrayList,18,Arrays,24,Bean Creation,3,Bean Scopes,1,BiConsumer,1,Blogger Tips,1,Books,1,C Programming,1,Collection,8,Collections,37,Collector,1,Command Line,1,Comparator,1,Compile Errors,1,Configurations,7,Constants,1,Control Statements,8,Conversions,6,Core Java,149,Corona India,1,Create,2,CSS,1,Date,3,Date Time API,38,Dictionary,1,Difference,2,Download,1,Eclipse,3,Efficiently,1,Error,1,Errors,1,Exceptions,8,Fast,1,Files,17,Float,1,Font,1,Form,1,Freshers,1,Function,3,Functional Interface,2,Garbage Collector,1,Generics,4,Git,9,Grant,1,Grep,1,HashMap,2,HomeBrew,2,HTML,2,HttpClient,2,Immutable,1,Installation,1,Interview Questions,6,Iterate,2,Jackson API,3,Java,32,Java 10,1,Java 11,6,Java 12,5,Java 13,2,Java 14,2,Java 8,128,Java 8 Difference,2,Java 8 Stream Conversions,4,java 8 Stream Examples,12,Java 9,1,Java Conversions,14,Java Design Patterns,1,Java Files,1,Java Program,3,Java Programs,114,Java Spark,1,java.lang,4,java.util. The execution planner may choose not to execute the GROUP BY at all if it is not needed. We can record feature from Java 14 alternative to the separate class for group by properties. Receive Java & Developer job alerts in your Area, I have read and agree to the terms & conditions. Published at DZone with permission of Jay Sridhar, DZone MVB. In Java, how do you group by? What screws can be used with Aluminum windows? Then we configured one consumer and one producer per created topic. Chennai, Tamil Nadu, India. I offer - Leadership Coaching, Career Coaching, Life Coaching, Team and Group coaching.<br><br> Seasoned Agile Coach with experience of coaching 200+ people (RTEs, SMs, BAs, POs and teams) on multiple Platforms and ARTs. The toString method is overridden to JavaTpoint offers too many high quality services. Suppose that we have the following entity: We start by asking how for each distinct state-city pair, we can find the total count of entries and the total sum of the product of rate and price ((rate * price)). Here is the POJO that we use in the examples below. As we did in the previous section, we define a class that encapsulates the aggregation: It might seem surprising at first, but a straightforward solution to groupings that are followed by simple aggregations is to use Collectors::toMap. Connect and share knowledge within a single location that is structured and easy to search. Normally these are available in SQL databases. amount += that. The exercises are based on a data model customer, order and product. final Aggregator<String, LoginEvent, LoginRollup> loginAggregator = new LoginAggregator (); final KGroupedStream<String, LoginEvent> appOneGrouped = appOneStream.groupByKey (); final . Storm spreads the tasks evenly on all the worker nodes. In this article, we will show you how to use Java 8 Stream Collectors to group by, count, sum and sort a List. In this post, we will see how we can make from simple single level groupings to more complex, involving several levels of groupings. Its java 8 Grou. Over 2 million developers have joined DZone. To establish a group of different criteria in the previous edition, you had to write the same 5 to 6 lines of code. amount ; this. As before we can get the aggregations for New York: It is also worth pointing out that because TaxEntryAggregation is a Java record, its immutable, so the calculation can be parallelized using the support provided by the stream collectors library. I have splitted it into two methods for readability: Now we have three nested maps containing each list of persons: The Java 8 Collectors API provides us with an easy way to group our collections. To filter on the count, we need to create You can replace ServiceCharacteristicDto::getName with: Use a lambda instead of a method reference. Some examples included grouping and summarizing with aggregate operations. What do we do if we have more sophisticated types like BigInteger or BigDecimal? have a more readable output in the console. How to create grouping if the number of arguments can be variable? By simply modifying the grouping condition, you can create multiple groups. From the output, you can clearly observe that we can see the count by designation and gender type. public static void twoLevelGrouping(List persons) { Java8Example1.java. For example, find the sum of the number of entries and the average price for a given state and city. We will use two classes to represent the objects we want to group by: person and pet. I took over, ad interim, the responsibilities of Head of Engineering for Relay (40+ developers, 5 teams). The groupingBy () method from the Collectors class returns a collector that groups the data before collecting them in a Map. how to perform Group By in java 8 with Collectors API? We will use two classes to represent the objects we want to group by: person and pet. Jan 2008 - Aug 20124 years 8 months. classifier function generates the keys in the map. Local mode: Read this to learn how to develop and test topologies in local mode. Since the CSV is quite simple (no quoted fields, no commas inside fields, etc. In this tutorial, We will learn how to group by multiple fields in java 8 using Streams Collectors.groupingBy () method and example programs with custom objects. Individual groups are, after all, just a list of objects on which you may access the stream by invoking the stream() method. This includes proficiency in several programming languages, including C, Python, and Java, and proficiency working with various software development life cycles, such as Agile development.<br><br> I got the chance to use these skills while working on the . Java Program to Calculate Average Using Arrays, Java 8 Streams Filter With Multiple Conditions Examples, Java 8 Streams Group By Multiple Fields with Collectors.groupingBy(), 150 Java Interview Questions and Answers The ULTIMATE List (PDF Download & video), 13 Best Java Decompilers for Download and Online Use for Java Developers, How to fix an illegal start of expression in Java, How to format/parse dates with LocalDateTime in Java 8 Example Tutorial, Switch as an expression in Java with Lambda-like syntax, Android Full Application Tutorial series, 11 Online Learning websites that you should check out, Advantages and Disadvantages of Cloud Computing Cloud computing pros and cons, Android Location Based Services Application GPS location, Difference between Comparator and Comparable in Java, GWT 2 Spring 3 JPA 2 Hibernate 3.5 Tutorial, Java Best Practices Vector vs ArrayList vs HashSet. Primary Skills: Providing infrastructure solutions based on Amazon web services (AWS) in a fast-paced, challenging, innovative company focused on reliability and . The first argument to groupingBy() is a lambda function which accepts a Player and returns a List of fields to group-by. Site design / logo 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA. For example, if you have a list of people, how do you organise them by city? See the original article here: Java 8 Streams Group By Multiple Fields with Collectors.groupingBy(). Welcome to WittCode! Look at the below examples, you will see the code with the. Java 8 Stream API is added with the data grouping capabilities as part of Collectors api. Grouping elements in a stream. In the Kafka Streams application, use a combination of cogroup and and aggregate methods as shown below. First, Create a class Employee with below properties. Application Architecture Design Principles, Grouping and Aggregations With Java Streams, The download stream from the initial grouping that we convert into a list (using, Finisher function (lines 49) where we use a lambda expression to create two different streams from the previous list to do the aggregations and return them combined in a new, The first parameter is a lambda expression to generate the keys of the map. This post will look at some common uses of stream groupingBy. Conclusion. To get the list, we should not pass the second argument for the second, Let us create the separate class with the group by properties and write implementation for equals(), hashcode() methods for. Performing multiple reduction operations using Streams. It's as simple as passing the grouping condition to the collector and it is complete. Grouping by multiple fields is a little bit more involved because the result map is keyed by the list of fields selected. There is also a summarizingDouble and summarizingLong. Blu-ray (Blu-ray Disc or BD), is a digital optical disc data storage format. Refer to the entity relationship diagram . 1. It enables you to categorise records based on specified criteria. How to add double quotes around string and number pattern? All rights reserved. Maybecomputing a sum or average? For instance: . By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. Let's consider a list of TaxEntry entities that it's defined by the following code: It is very simple to compute the total number of entries for a given city: Collectors.groupingBy takes two parameters: a classifier function to do the grouping and a Collector that does the downstream aggregation for all the elements that belong to a given group. Use apache Pair class if you have only two group by properties. To add insult to injury the summarizing* methods only provide summary statistics for, min, max, count, sum, and average. The resultis a map of year and players list grouped by the year. Apply for this job now and search thousands of additional jobs for veterans and their spouses. You only have to pass To build a group of objects from a list in Java SE 6 or 7, you must iterate over the list, inspect each element, and place them into their own list. Note that I am using list of attributes for grouping by, not string concatenation of attributes. Examples to grouping List by two fields. Receive Java & Developer job alerts in your Area, I have read and agree to the terms & conditions. By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. In this tutorial, We will learn how to group by multiple fields in java 8 using Streams Collectors.groupingBy() method and example programs with custom objects. Example program to show the best and maintainable code if we have more then 3 fields in the group by combination with custom group by class. This is the list of fruits we will use for the examples. All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners. It was designed to supersede the DVD format, capable of storing several hours of high-definition video (HDTV 720p and 1080p).The main application of Blu-ray is as a medium for video material such as feature films and for the physical . The result is a Map with the fruit's name In this tutorial, We will learn how to group by multiple fields in java 8 using Streams Collectors.groupingBy () method and example programs with custom objects. Collections.frequency (list, i) Then for each element in the collection list, if the frequency of any element is more than one, then this element is a duplicate element. Is it better to visit London, Paris, or Tokyo? Stream is a sequence of elements from a source that supports sequential and parallel aggregate operations. Using the Stream () method - This method will consider the collection as the data source and generate a sequential stream. When you print the Map the result will look like this: We can also pass the Collectors.counting() as a parameter to the groupingBy. @Michael yes, but if that's an issue, it can be trivially solved by adding a separator charater between the concatenated fields. See the original article here. Suppose that we want to find the weighted average of the rate-price, and the sum of all the prices for each state and city pair. Instead of writing multiple queries and combining the results with a UNION, you can simply use GROUPING SETS. The Java 8 Stream API lets us process collections of data in a declarative way. Stream Grouping. First, let us understand the simple group by operation to find the number of occurrences of each string from List. All rights reserved. There are multiple services implemented in the Private Banking sector to provide and maintaining multiple bank officer in role of Banker , Investor etc to the prospect or client who might be an individual or part of the group in the Private banking. how to perform Group By in java 8 with Collectors API? To review, open the file in an editor that reveals hidden Unicode characters. can one turn left and right at a red light with dual lane turns? If we want to group by 4 fields then need to call Collectors.groupingBy() also 4 times which makes code ugly and not readable. London Area, United Kingdom. Within each gender group, it creates another group based In this program, we have gathered the count of employees but rather than this we can get the list of Employees. The library does not provide a simple solution to this problem. The below examples are implemented as described and suggested way. The worker node's role is to listen for jobs and start or stop the processes whenever a new job arrives. Examples Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation. We use the groupedBy() version that accepts the value-type. Author: Venkatesh - I love to learn and share the technical stuff. These concepts are described below. It groups objects by a given specific property and store the end result in a ConcurrentMap. The code above generates the following result. Opinions expressed by DZone contributors are their own. Maybe computing a sum or average? This function creates, The second parameter produces the values of the map. A topology runs in a distributed manner, on multiple worker nodes. @Eugene how can anyone be sure about that? For example, with the previous example, the total number of entries for a given state andcity. If you have any doubt or any suggestions to make please drop a comment. Creating a new class for GroupBy fields makes us to call only once the groupingBy() method. Or perhaps performing an aggregate operation such as summing a group? From the output, you can clearly observe that we can see the count by designation and gender type. In this video of code decode we have demonstrated how we can do Group By in java 8 same as we do in SQL using Group By Clause in SQL Queries. Summarizing using grouping by is a useful technique in data analysis. The code above collects the results into the following type: Instead of storing the values in a List (inside the Map), how can we put it into a Set? We load the following sample data representing player salaries. If you are doing string concatenation, you may have some corner cases like attributes (A, BC, D) and (AB, C, D) will result in same string. To accomplish this, you can use the groupingBy() method provided by Stream and Collector. By Multiple Fields. Things are a little more complicated if we try to find compound groupings. Making statements based on opinion; back them up with references or personal experience. In the previous article, We have shown how to perform Group By in java 8 with Collectors API? Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries. With this in hand, the solution now is simple: For Collectors::groupingBy we set the classifier function using a lambda expression that creates a new StateCityGroup record that encapsulates each state-city. Java Stream - limit() With Examples; Java Stream - distinct() With Examples; Reduction Operations in Java Stream API; Parallel Stream in Java . He is specialized in web application development with experience in both frontend and backend. Not the answer you're looking for? In Java 8, you can generate streams using the collection interface in two different ways -. For each element in the stream, count the frequency of each element, using Collections.frequency () method. Continuous upskilling knowledge to keep updated with the IT and new age technologies mainly in the stream of Cloud. This is for a list of records using Java streams and the Collectors API, so it provides us the ability to process huge amounts of data quickly and efficiently. The Employee objects in the stream are collected, with the inputs this time being method reference to Employee's getAge() method(as mapper function), and Collectors.maxBy() Click to Read tutorial on maxBy()/minBy() collectors (as downstream collector) with Integer's natural comparison order being used as it's comparator Click to Read in-depth tutorial on Java 8 . Some people will argue that we can always write custom Collectors, but this requires knowing the Collector interface and a good understanding of the stream collector flow. And also add toString() method to see the Employee object in readable format. First, Create a class Employee with the below properties. For example, you cant do averages of any kind. A guide to group by two or more fields in java 8 streams api. Since the CSV is quite simple (no quoted fields, no commas inside fields, etc. Sum using Java Stream.reduce() First, Stream api has a reduce() method which takes the accumulator as an argument. We load the following sample data representing player salaries. More on JavaProgramTo.com. However using the Java 8 Streams and Collections facility, it is possible to use these techniques on Java collections. ); Java 8 Stream support sequential as well as parallel processing, parallel processing can be very helpful in achieving high performance for large collections. The examples in this post will use the Fruit class you can see below. We could accomplish this with a for loop, checking each individual, and placing them on a list of HashMaps with the same city, but in Java 8, you don't have to hack your way around like that; you have a far simpler alternative. Cypress vs. Playwright: Which Is the Best Testing Tool? When we group elements from a list, we can subsequently aggregate the fields of the grouped elements to perform meaningful operations that help us analyze the data. API Note: The mapping () collectors are most useful when used in a multi-level reduction, such as downstream of a groupingBy or partitioningBy. Is Java "pass-by-reference" or "pass-by-value"? We create a List in the groupingBy() clause to serve as the key of the map. I am a passionate Java developer with years of experience, and a love for sharing my knowledge through talks and my personal blog. Eliminating the intermediate variable grouped, we have the entire processing pipeline in a single statement as shown below. Same applies. Over 2 million developers have joined DZone. Around 9 years of experience in Cross-Platform application development and design using Object-Oriented Programming, Core Java, J2EE technologies. How to determine chain length on a Brompton? The groupingBy () method is overloaded and it has three versions: as key and a list of fruits as the value. Remember the second argument collects the value-type of the group into the map. Next, We will try to implement the group by on two fields such as designation and gender. How do I read / convert an InputStream into a String in Java? That means inner aggregated Map value type should be List. Below examples are implemented as described and suggested way. to get away from possible un-intentional duplicates because of String concat, you could use: x -> Arrays.asList (x.getName (), x.getValue (), x.getKey ()) Share Improve this answer Follow edited Jun 15, 2018 at 13:59 answered Jun 15, 2018 at 8:57 Eugene 115k 13 193 297 1 See my comment on Eran's answer. Because all the object you add to the collection will be the same type of static field.Static complete guide herehttps://www.javaprogramto.com/2013/08/static-in-java.htmlIf it is only a final, it is not advisable to set the values using object.finalField. - Design automated datastore deployment to AWS. The downstream Collector is the same as before. The equals and hashCode methods are overridden, so GROUP BY is a SQL aggregate operation that is quite useful. ) There are several ways in order to sort a list collection by multiple attributes (keys) of its elements type. JCGs serve the Java, SOA, Agile and Telecom communities with daily news written by domain experts, articles, tutorials, reviews, announcements, code snippets and open source projects. java2s.com | Demo Source and Support. However using the Java 8 Streams and Collections facility, it is possible to use these techniques on Java collections. We should look for better alternatives. and to get some basic statistics. Implemented the Spring Batch to import the Marketplace bulk xml and process using Java, J2EE, Spring Batch, QuartzJob and Scheduler . Remember the second argument collects the value-type of the group into the map. We'll assume that the reader has a basic understanding of Java Streams and the utility Collectors class. It allows you to define multiple grouping sets in the same query. PyQGIS: run two native processing tools in a for loop. Lets see how we would do it: The Collectors::toMap (line 2) takes three parameters, we do the following implementation: Lets demonstrate how this will work setting up some sample data: To get the results for New York from the previous code sample is trivial: This is a straightforward implementation that determines the grouping and aggregation of multiple fields and non-primitive data types (BigDecimal in our case). Java's Streams API is a powerful and versatile tool for processing data. Join them now to gain exclusive access to the latest news in the Java world, as well as insights about Android, Scala, Groovy and other related technologies. This collector will give you the number of objects inside To accomplish this, we need to implement a two level grouping. The code becomes, inefficient, very repetitive, and less than desirable. The Spring Batch, QuartzJob and Scheduler examples below and a love for sharing my knowledge through talks and personal. Given specific property and store the end result in a declarative way my knowledge through and... Statements based on a data model customer, order and product Java 8 Streams and the average price a. Possible un-intentional duplicates because of string concat, you can clearly observe we. { Java8Example1.java result is a map of year and players list grouped by the list of fruits we will the... Some examples included grouping and summarizing with aggregate operations 14 alternative to the &! Development with experience in both frontend and backend my personal blog fruits we will to! Example, with the data grouping capabilities as part of Collectors API groupingBy. An argument the total number of objects inside to accomplish this java stream multiple grouping you can create multiple.! Software developer working in a distributed manner, on multiple worker nodes a that! The library does not provide a simple usage of groupingBy ( ) method is overloaded and it three. Lane turns fields, no commas inside fields, etc are several ways in to... Given java stream multiple grouping property and store the end result in a map of year and list... Contributing an answer to Stack Overflow a distributed manner, on multiple worker nodes grouping by multiple with! Aggregate operation that is quite useful. have shown how to create grouping if the number of entries the... Editor that reveals hidden Unicode characters in Cross-Platform application development with experience in both frontend backend... Reader has a reduce ( ) clause to serve as the key of the number occurrences. For grouping by multiple fields is a powerful and versatile Tool for processing data we have the entire processing in. Result map is keyed by the year Collections.frequency ( ) method, use combination! List of fruits as the value the technical stuff readable format using the collection interface in different! The list of employees but rather than this, we use in the Stream count. To visit London, Paris, or Tokyo simple solution to this problem, order and product as described suggested. Price for a given state andcity application development with experience in Cross-Platform application development and design Object-Oriented..., open the file in an editor that reveals hidden Unicode characters Programming, Java. By: person and pet provided by Stream and collector is overloaded and is... Mode: read this to learn and share the technical stuff objects by a given state.! To accomplish this, you will see the count by designation and gender my knowledge talks. Designation and gender data before collecting them in a ConcurrentMap we configured one consumer and one producer per created.... Of additional jobs for veterans and their spouses a sequence of elements from a source that supports and... To implement a two level grouping implemented as described and suggested way we show to... Multi level groupings sequential and parallel aggregate operations alerts in your Area, I have read and to. Your Area, I have read and agree to the terms & conditions two fields such as and... Veterans and their spouses are the property of their respective owners develop and test topologies in mode... I read / convert an InputStream into a string in Java 8 Stream API lets process... The end result in a distributed manner, on multiple worker nodes concatenation of attributes for grouping by multiple is! Get the list of fruits we will try to find the sum of number... Remember the second argument collects the value-type of the group into the map as described and suggested way level. Collector will give you the number of arguments can be variable version that accepts the value-type ;. With dual lane turns application, use a simple solution to this.... Unicode characters include non-primitive data types with multi and cross-field calculations in both frontend backend... State and city previous article, we will try to implement multi groupings. We create a class Employee with below properties of Collectors API use Pair. Learn and share the technical stuff groupingBy ( ) first, let us understand the simple group in. Will see the original article here: Java 8 Streams group by in?! Of objects inside to accomplish this, we have the entire processing pipeline in declarative., Core Java, J2EE, Spring Batch, QuartzJob and Scheduler Inc ; user contributions licensed CC. Passing the grouping condition, you can clearly observe that we use the Fruit class you can Streams... Inc ; user contributions licensed under java stream multiple grouping BY-SA them in a consulting firm based in Barcelona fields selected its... Unicode characters for sharing my knowledge through talks and my personal blog, is a little complicated... Not string concatenation of attributes any doubt or any suggestions to make please drop comment! Software developer working in a consulting firm based in Barcelona the equals and hashCode methods are overridden so! Design / logo 2023 Stack Exchange Inc ; user contributions licensed under CC BY-SA my knowledge through talks and personal... To Oracle Corporation lets us process collections of data in a consulting firm based in Barcelona the interface! Answer, you will see the count by designation and gender type at the below properties makes us to only... How do They Work to perform group by properties and pet you to define multiple SETS... Only once the groupingBy ( ), we have shown a couple of to... We want to group the data source and generate a sequential Stream with experience in both frontend backend! Is overloaded and it has three versions: as key and a love for sharing my knowledge through and! Methods are overridden, so group by properties xml and process using Java,,... Post your answer, you can create multiple groups aggregated map value type should be list how. The execution planner may choose not to execute the group into the.. Use two classes to represent the objects we want to group by person. Both frontend and backend it groups objects by a given state andcity following sample data representing player salaries for. Readable format specific property and store the end result in a declarative way age... Accomplish this, we have gathered the count of employees but rather than this, you do! Core Java, J2EE, Spring Batch, QuartzJob and Scheduler light with dual lane turns use. Visit London, Paris, or Tokyo a two level grouping organise by! We load the following sample data representing player salaries data by year multiple queries and combining the results a! Are left out to make it more readable the tasks evenly on all the worker.. To group the data source and generate a sequential Stream the United States and other countries that accepts the.. Of data in a distributed manner, on multiple worker nodes grouping and summarizing with aggregate operations if. Of year and players list grouped by the year a love for sharing my knowledge through talks and personal! The technical stuff player and returns a collector that groups the data by year clause to serve as key! By operation to find compound groupings CSV parser collector will give you the of. And aggregate methods as shown below of data in a ConcurrentMap Kafka Streams application, use simple! Price for a given specific property and store the end result in a single as! Programming, Core Java, J2EE technologies an InputStream into a string in Java 8, you see... Disc or BD ), we can add different layers of groups to implement the group into the map in! Geeks are the property of their respective owners attributes for grouping by multiple fields is a trademark registered. Process collections of data in a map Relay ( 40+ developers, 5 teams ) give you the of... Here is the list of people, how do They Work to learn how to perform by. We 'll assume that the reader has a reduce ( ) method is overloaded it! A software developer working in a declarative way state andcity performing an aggregate operation such as designation and.! Part of Collectors API and versatile Tool for processing data output, you agree to the class! We 'll assume that the reader has a reduce ( ) method which takes the accumulator as an argument toString... Developer with years of experience, and a love for sharing my knowledge through talks and my blog! Single statement as shown below be sure about that however using the Stream, count the frequency each. Not connected to Oracle Corporation to groupingBy ( ) the total number of entries for a given specific property store... ( blu-ray Disc or BD ), we can see below Disc storage! And product here: Java 8 with Collectors API to implement a two level grouping this. A SQL aggregate operation that is structured and easy to search and players grouped... This post will look at the below properties number pattern given state andcity that include non-primitive data types with and... I took over, ad interim, the total number of objects inside to this., using Collections.frequency ( ) method provided by Stream and collector the library not. Those cases ), we will use two classes to represent the objects we want to by... Uses of Stream groupingBy ) version that accepts the value-type of the map Spring... That reveals hidden Unicode characters a powerful and versatile Tool for processing data quite simple ( no quoted fields etc... Web application development with experience in Cross-Platform application development and design using Object-Oriented Programming, Core Java, J2EE.... Can see the Employee object in readable format Disc or BD ), we will use the Fruit class can. As key and a love for sharing my knowledge through talks and my personal blog below are!