I/O Fundamentals in JAVA 1

Command Line Arguments:- When a Java technology program is launched from a terminal window, we can provide the program with zero or more command line arguments. Those command line arguments allow the user to specify the configuration information for the application. These arguments are strings; either standalone tokens, such as arg1, or quoted strings, such as “another arg”. The sequence of arguments follows the name of the program class and is stored in an array of String objects passed to the static main method. The code given below is to test the command…Read more

Generics in JAVA 2

Generic Map Example:- The MapPlayerRepository class in a given code shows a more practical way to use a generic collection. The program creates a repository of players. It declares a variable (players) of type HashMap<String, String> which stores players based on their position and name. It defines two methods put() and get() to add the elements to the map repository and to retrieve the elements from the map repository respectively. import java.util.*; public class MapPlayerRepository { HashMap<String, String> players; public MapPlayerRepository() { players = new HashMap<String, String>(); } public String get(String position) {…Read more

Generics in JAVA 1

Generics collection:- The Collection classes use the Object type to permit different input and return types. We need to cast down explicitly to retrieve the object we need. This is not type safe. Although the existing collections frame does support homogeneous collections (that is collections of one of the type object, for example Date objects), there was no mechanism to prevent the other object types from be inserted into the collection. Also retrieval almost always required a cast. The solution for this problem is to make a use of generics functionality. This was…Read more

Collections in JAVA 3

Starting towards next part of collections in JAVA. Previous part links are given here: Collections in JAVA 1 and Collections in JAVA 2 look at these, Now come towards this post. Iterators:- You can scan (iterate over) a collection using an iterator. The basic Iterator interface enables you to scan forward through any collection. In the case of an iterator over a set, the order is non deterministic. The order of an iterator over a list moves forward through the list elements. A List object also supports a ListIterator, which permits you to scan the…Read more

Collections in JAVA 2

In the collection framework Map interface is also the important core interface. So now we are going to discuss the Map interface. The Map interface:- Maps are sometimes called as associative arrays. The object of a Map interface describes mapping from key to value. By the definition, Map interface does not allow the duplicate elements and a key can map to one value at most. A Map interface does not extend a collection interface because Map interface represents mapping not collection of an object. The sorted map interface extends the Map interface. Some…Read more

Business Process Outsourcing

This article gives the broad information of BPO. BPO is a subset of outsourcing that involves the contracting of the operation and responsibility of specific business function to third party service provider. This was associated with manufacturing firms, such as Coco Cola that outsourced large segments of its supply chain. In that contemporary context, it is primarily used to refer to the outsourcing of services. BPO is categorized into back office outsourcing –which includes internal business function such as human resource or finance and accounting, and front office outsourcing – which includes customer…Read more

Collections API 1

Collection:- Collection is a single object which manages a group of objects. And in collection we call object as an elements. Before the release of the JAVA SE 5.0 collections maintained references to object of type Object so, from that any type of an object can be stored in the collections. After Java SE 5.0 onwards, we can use the generic collections. By using generic collection we can maintain the object without type casting. Collection API which contains interfaces that group objects as one of the following:- Collection:- A group of an objects…Read more

What is Switch Mode Power Supply (SMPS)?

This article gives the information of SMPS devices. SMPS or switched mode power supply is an electronic power supply unit that incorporates a switching regulator. In linear power supply uses a regulator. Linear regulator uses a transistor biased in its active region to specify an output voltage; But in SMPS actively switches a transistor between full saturation and full cut off at a high rate. In SMPS the active device that provides regulation is always operated in a switched mode i.e. it is worked in either in cut off or in saturation. The…Read more

Exception Handling in JAVA 2

‘throw’ keyword:- In above example, exception occurs in implicit manner but our exception explicitly by creating an object or that exception. For throwing an exception explicitly we have to use a ‘throw’ keyword which throws as an exception towards appropriate catch block. e.g. void fun() { int i; try{ System.out.println(“inside a try block.”); i=10/0; }catch(ArithmaticException e) { System.out.println(“inside the 1st catch block.”); throw new ArithmaticException(“my exception.”); } } public static void main(String args[]) { try{ System.out.println(“before calling a function”); fun(); System.out.println(“after calling a function”); } catch(ArithmaticException e) { System.out.println(“inside catch of a main”); //…Read more

What is Processor Mode?

 This article gives the information of Processor Mode. Processor Mode also called as CPU modes or CPU “privilege level”. The CPU modes are used by processor to create an operating environment for automatic. Specifically, the CPU mode controls how the processor sees and manages the system memory and task that use it. There are three different modes of operation but one more mode is added for new 64 bit processor: Real Mode. Protected Mode. Virtual Mode Real Mode. 64 bit extension Mode. Real Mode: The original IBM PC could only address 1MB of…Read more