by Dinesh Thakur

An operator is a special symbol that tells the compiler to perform a specific mathematical or logical operation on one or more operands where an operand can be an expression. An operation is an action(s) performed on one or more operands that evaluates mathematical expressions or change the data.

 
by Dinesh Thakur

final: Variables are useful when you need to store information that can change as the program runs. However, there may be certain situations in the program in which the value of the variable should not be allowed to modify. It is accomplished using a particular type of variable known as the final variable. The final variable also called constant variable. It is a variable with a value that cannot modify during the execution of the program.



 
by Dinesh Thakur

In Java, Jump statements are used to unconditionally transfer program control from one point to elsewhere in the program. Jump statements are primarily used to interrupt loop or switch-case instantly. Java supports three jump statements: break, continue, and return.

 
by Dinesh Thakur

Different types of control statements: the decision making statements (if-then, if-then-else and switch), looping statements (while, do-while and for) and branching statements (break, continue and return).

 
by Dinesh Thakur

Multi-dimensional arrays that contain more than one index and can store information in multiple dimensions.  The most common one is a two-dimensional array, also called a matrix or table. In the two-dimensional array, each element associated with two indexes.  We can visualize the two-dimensional array as a spreadsheet, rectangular in shaper and containing elements that divided into columns and rows. However, Java does not indeed support multidimensional arrays. However, one can achieve the same functionality by declaring an array of arrays.



 
by Dinesh Thakur

Just as you can pass primitive type values to methods, you can also pass arrays to a method. To pass an array to a method, specify the name of the array without any square brackets within the method call. Unlike C/C++, in Java every array object knows its own length using its length field, therefore while passing array's object reference into a method, we do not need to pass the array length as an additional argument. For example: Suppose we have an integer array num containing 10 elements.

 
by Dinesh Thakur

Perhaps one of the most important of all concepts that you need to learn in order  to be effective is the array. Until now, we have looked at variables that hold just one  value – the ints hold one number and the strings hold one text string. Arrays are  used when we want to hold two or more values, perhaps a list. Arrays can be  thought as columns in a spreadsheet – a spreadsheet can have one or it can have  many columns.

 
by Dinesh Thakur

Arrays Definition: Perhaps one of the most important of all concepts that you need to learn to be effective is the array. Until now, we have looked at variables that hold just one value – the ints hold one number and the strings hold one text string. Arrays are used when we want to hold two or more values, perhaps a list. Arrays can be thought as columns in a spreadsheet – a spreadsheet can have one, or it can have many columns.  

 
by Dinesh Thakur

Strings often used in programming. Most of the programs use strings such as names, addresses, messages and many more. A string is a sequence of Unicode characters. Unlike most of the programming languages such as C/C++ where strings treated as an array of characters, Java treats a string as an object. Java provides the following classes for storing and processing strings.

 
by Dinesh Thakur

Elements that can be added to the Vector must be of type java .lang. Object. In other words, vectors cannot handle primitive data typeslike int, float, char and double as they are not objects. So in order to work with primitive type variables as if they were objects, Java provides class for each of the primitive types. These classes are known as wrapper classes.



 
by Dinesh Thakur

Generics are used to enforce type-safety in a program. A type-safe program does not have compilation and run-time errors that can result from using incorrect data types.



 
by Dinesh Thakur

Java ArrayList class is a part of unified architecture (collection framework) interfaces are present in java.util package and used when we want to change the array size when your Java program run. You know that arrays are that they're fixed size that must be specified the number of elements when the array created. How to add elements values to an array in java that filled? It's an easy way to create a more extensive array, and all its elements are copied from the (smaller) source array to the (broader) target array, with the remaining space for new elements. It's an alternative is to use the ArrayList whose size can change frequently. An instance of Java ArrayList class contains an array that dynamically increased as required so that it relaxes the programmer from the burden of doing this.



 
by Dinesh Thakur

The collections framework consists of several interfaces and classes (in the java.util package) that define data structures to store data, search for and retrieve data, and perform other operations on a collection efficiently. An example is the ArrayList class.



 
by Dinesh Thakur

Singleton Class in Java: A given class whose object (an instance of the class) is instantiated only once in JVM (Java Virtual Machine) and that only global instance of an object of the class used for every access. Such objects are mainly immutable.

 
by Dinesh Thakur

In Java, there is no such thing as a call by reference, only a call by value. If a method that passes value called, we are calling by value and any change in the method called do not get affected in the method used to call.  Where a call by value is used, there is no change to the original value. Have a look  at the Example below:

 
by Dinesh Thakur

Copy Constructor: Sometimes a programmer wants to create an exact but separate copy of an existing object so that subsequent changes to the copy should not alter the original or vice versa. This is made possible using the copy constructor. It takes the object of the class as a reference to the parameters. This means that whenever we initialize an instance using value of another instance of same type, a copy constructor is used.

 
by Dinesh Thakur

Method Overloading: When multiple methods in the same class with same name, having different functions or types of parameters, it is known as Method Overloading. When an overloaded method is invoked, it is the responsibility of the compiler to select the appropriate overloaded method based on the number of argument(s) passed and if the numbers of argument(s) are same then depending upon the type of argument(s) passed to the method. Thus, the key to method overloading is a method's parameter list. A method's return type is not enough to distinguish between two overloaded methods. If the compiler detects two methods declarations with the same name and parameter list but different return types then it will generate an error.

 
by Dinesh Thakur

A nested class as the name suggests is a class that is defined inside another class. It is merely a convenient way of grouping two or more classes together into a single unit or module. A class that contains a nested class is known as the enclosing or outer class of the nested class.

 
by Dinesh Thakur

Interfaces and abstract classes both implements polymorphic behaviour and seem to be similar but they are different in the following ways:
1. An interface is purely abstract i.e. methods in an interface only have declarations no implementations. On the other hand, abstract class methods may or may not have an implementation.

 
by Dinesh Thakur

When more than one thread has to use a shared resource, Java finds a way of ensuring that only one thread uses the resources at one point of time; this is called synchronization.

 

Page 4 of 7

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.