Java Util Examples List part-II (data structures in java)

21. Creating a Copy of a Collection
This tells how to create and then copy the collection. The copied collection contains the reference to the object. In-fact, objects are not cloned.

22. Making a Collection Read-Only

This section describes you how to make a collection read-only. In this section, list (component of the collection) has been represented for making it read-only. By default, list is not read-only.

23. Sorting a List
This section gives you the best illustration for sorting elements of a Collection. You can see how to sort all elements of a Collection in ascending or descending order.

24. Creating a Hash Table
This section explains the implementation of the hash table. What is the hash table and how to create that? Hash Table holds the records according to the unique key value. It stores the non-contiguous key for several values.

25. Finding an Element in a Sorted Array
In the sorted array, searching is very easy. In this section, you will learn how to sort an array and how to find a text in the sorted array. For binary search first you must sort the array and then apply the binary search.

26. Reading a Properties File
In this section, you will learn how to read the key-value of properties files in Java. The properties file provides the general text editor, which have the keys and it’s values.

27. Getting all properties of a properties file
In this section, you will learn how to get all keys and it’s values of the properties files in Java. Java provides the features to collection of all keys and values of the properties file.

28. Setting property to a properties file
In this section, you will learn how to add the keys and it’s values of the properties files in Java. You know the properties files have the keys and values of the properties files.

29. Scheduling a Timer Task to Run at a Certain Time and Repeatedly
In this section, you can learn how to schedule a timer task to run at a certain time and repeatedly. There is an example given for the illustration. This program asks you for the way of performing the task whether at the certain time or repeatedly.

30. Getting the Current Time
In this section, through the given program you can get the current time in the proper format (Hour:Minute:Second AM/PM). This program shows the current time by using the various methods of the Calendar class.

31. Getting Information of All Available Time Zones
Time Zone is the specified part of the earth that holds the special standard of the time i.e. termed as local time. Usually time zone is based on the GMT (Greenwich Mean Time).

32. Getting the Current Date
In this section, through the given program you can get the current date in the proper format (Day/Month/Year). This program shows the current date by using the various methods and fields of the Calendar class.

33. Determining the Number of Days in a Month
This section will show the way of counting the number of days of a month in the specified year. Following program takes the year as input through the keyboard and shows the number of days in the February month of the mentioned year if the year is valid other it will show the error message and terminate the program.

34. Comparing Dates
This example illustrates you how to compare two dates. Generally dates are calculated in milliseconds. In this section, we will show you how to compare two given dates. To compare dates the given program is helpful for application development. You can easily use the code for comparing dates.

35. Determining a Person’s Age
Here, you can calculate the age of a person easily through the given program.

36. Determining If a Year Is a Leap Year
Leap Year is the year contains an extra day. In the leap year, February month contains 29 days since normally February month has 28 days. The year which is completely divided by 4 that is the leap year.

37. Determining the Day-of-Week for a Particular Date
This section simply show the current day in word i.e. the Day of Week for a particular date. Here, you can learn about the way of doing that.

38. What is a JAR file in Java
JAR file is the compressed file format. You can store many files in a JAR file. JAR stands for the Java Archive. This file format is used to distribute a set of java classes. This file helps you to reduce the file size and collect many file in one by compressing files.

39. Creating a JAR file in Java

This section provides you to the creating a jar file through the java source code by using the jar tool command which is provided by the JDK (Java Development Kit).

40. Listing the Entries of a JAR File Manifest

This section shows you how you can read the content of jar file from your java program and list the content. This section helps you to view the contents of the jar file without extracting it

Leave a Reply

You must be logged in to post a comment.

Close