Java Tutorial

by Dinesh Thakur Category: Introduction to Java

In this Example we Reading amount, Year and interest in the class Scanner becomes analogous to reading string. In this example, the three numbers are read from the console, and then perform Simple Interest,Compound Interest operations and results printed on the screen in formatted output.

 
by Dinesh Thakur Category: Introduction to Java

The RMI architecture, shown in Figure, describes how remote objects behave and how parameters are passed between remote methods. Remote method invocation allows the program to define separately the behaviour and the code that implements the behaviour and allows running them on separate JVMs. This principle facilitates the clients to focus on the definition of a service while the servers can focus on providing the service.

 
by Dinesh Thakur Category: Introduction to Java

Enumeration (enum) was not originally available in Java though it was available in other language like C and C++ but eventually Java realized and added to version 5 of Java were the safe type enumerations (Type Safe Enums), which allows you to create enums in Java, just as they exist in other technologies. It is defined by the reserved word enum, and each item in the enumeration is represented by an object of the same type as the Enum. The definition of an enumeration is no more than the definition of a special kind of class. If they were in another package, they should be imported like any other normal classes.

 
by Dinesh Thakur Category: Introduction to Java

Polymorphism is a very powerful concept that allows you to design amazingly flexible applications. The word 'Polymorphism: is derived form two Greek words 'poly' which means many and 'morphos' which means forms. So, polymorphism means the ability to take many forms.

 
by Dinesh Thakur Category: Introduction to Java

Modifiers are keywords used to define the scope and behaviour of classes, methods and variables in Java. Access modifiers specified who can access them. Java has a wide variety of modifiers that can be categorized as shown below:

 
by Dinesh Thakur Category: Introduction to Java

Definition: Encapsulation and data hiding are the key features of object oriented programming. Encapsulation refers to the ability to package related behavior in an object bundle and control or restrict their access in both function and data from other objects. It necessarily is all about packaging related stuff together and keeping them away from external elements. You will note that keywords encapsulation along with data hiding is used interchangeably all over.

 
by Dinesh Thakur Category: Introduction to Java

Public keyword is an access specifier.

Static allows main() to be called without having to instantiate a particular instance of class.

 
by Dinesh Thakur Category: Introduction to Java

It is quite a tedious job to keep track of all the objects that have been created during the program development. It is tougher to keep track of the objects that are not being used now or their reference have been removed or the objects that have gone out of scope.

 
by Dinesh Thakur Category: Introduction to Java

Java interface used for achieving 100% abstraction because of the interface only contains methods without any implementation or body. However, it contains only abstract methods and constants (final fields). Any field that declared inside interface is public, static, and final by default, any method is an abstract public method. It specifies what must be done but not how. Once an interface is defined, class implements an interface by providing an implementation for each method declared by the interface. Also one class can implement any number of interfaces. Interfaces have the following advantages.

 
by Dinesh Thakur Category: Introduction to Java

Objects and classes are the essential concepts in OOP as they are what we use for writing our programs. Java objects may be both physical and logical entities, but classes are only logical entities.

In the real world, you'll often find many individual objects all of the same kind.All the objects that have similar properties and similar behavior are grouped together to form a class.

 

Page 3 of 80



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.