Java Tutorial

by Dinesh Thakur Category: Control Structures

Factorial Number is the product of natural numbers from one to that particular number.  Mathematically, n! = 1 * 2 * 3 * .... * (n-1) * n

 
by Dinesh Thakur Category: Control Structures

Fibonacci Series is series of Natural Number in the Sequence of: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55...., The first two number in Fibonacci series are 0 and 1, where next number is equivalent to sum of previous two number. in this example we use Recursion method , Recursion means calling the same function again and again to reduce the complexity of the problem solved.

 
by Dinesh Thakur Category: Control Structures

Fibonacci series numbers are in the following Sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144..., The first two number in Fibonacci series are 0 and 1, and each subsequent next number is the sum of the previous two Numbers.

 
by Dinesh Thakur Category: Control Structures

step 1: Read n, x

step 2: Set r= 1

step 3: If value of n is 1 then print n and goto step - 8

step 4: Repeat through step-6 until j > 0

step 5: r=r*i

step 6: Update j as j=j-1

step 7: Print r

step 8: Exit

 
by Dinesh Thakur Category: Control Structures

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 Category: Control Structures

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 Category: array

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 Category: array

Before using the element of an array, it must have an initial value. In some programming languages ​​do not set initial values default, and then when trying to access to an item an error occurs. In Java, all the variables, including the elements array have initial default value (default initial value). This default initial value is equal to 0 in numeric types or equivalent types (eg null for objects and false for boolean).

 
by Dinesh Thakur Category: array

In Java arrays have a fixed length that is specified during initialization, and determines the number of its elements. Once we set the length of the array is not possible to change it.

 
by Dinesh Thakur Category: array

The Vector object store objects of any kind are extremely  although flexible operations on objects of this class are slower than  operations on common vectors (arrays). The capacity of the vector is the maximum amount of  elements that it can hold at a given instant. Its size corresponds to  number of elements actually stored. Having your whole capacity occupied  (size = capacity), adding a new element causes the automatic increase  capacity vector. If an increment is specified via its constructor, this increase occurs with this granularity, otherwise the capacity is doubled.

 
by Dinesh Thakur Category: array
 
by Dinesh Thakur Category: array

When we want to enter details of several students or workers or patients, then instead of making separate objects by different names, it is better to make an array of object of that class. By making an array of object, we can take the advantage of loops to feed and retrieve data.

 
by Dinesh Thakur Category: array
 
by Dinesh Thakur Category: array
 

Page 10 of 40



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.