Showing posts with label Playing with Numbers. Show all posts
Showing posts with label Playing with Numbers. Show all posts

Spring Framework Check if a point lies on a line

You might be familiar with the line equation ax+by+c=0. Where a,b,c are constants and x,y are the points on the line. Now let us check whether the given points lie on the given line. The program inputs the values of a,b,c and the values of x,y and then gives whether the point lies on the line or not. One of the major themes of this program is to illustrate the assertion operator.


import java.util.*;

class CheckLine

{

    public static void main(String args[])

    {



    // Create Scanner object

    Scanner s=new Scanner(System.in);



    // Enter the a,b,c

    System.out.println("Enter the a,b,c values");

    int a=s.nextInt();

    int b=s.nextInt();

    int c=s.nextInt();



    /* Note: Line equation is ax+by+c=0 */

    

    // Enter the x,y

    System.out.println("Enter the x,y planes on the line");

    int x=s.nextInt();

    int y=s.nextInt();



    // Get the expression

    boolean p=doTheyLie(a,b,c,x,y);

    

    // "lies" if p is true "does not lie" if not

    String st=p?"lies":"does not lie";

    

    System.out.println("The given point "+st+" on the line");

    }



    public static boolean doTheyLie(int a,int b,int c,int x,int y)

    {

     return a*x+b*y+c==0;

    }

}

Sample outputs of the program




Enter the a,b,c values


6


2


8


Enter the x,y planes on the line


-2


2


The given point lies on the line







Enter the a,b,c values


6


7


8


Enter the x,y planes on the line


2


0


The given point does not lie on the line


Explaining the assertion and CheckLine

return a*x+b*y+c==0; Return whether the line equation formed using this equals 0.

String st=p?"lies":"does not lie"; Set the value to the string st. If the expression p is true, then lies else does not lie is stored in st. The : expression is after the else.

Spring Framework Round off number to nearest tens

Here is a program on rounding off a number to nearest tens. For example, 35 will be rounded off to 30 and 36 to 40.

Description

The program comes with the simple logic that uses the right most digit of the given number and then identifies the nearest tens to which the number can be rounded. A number with right most digit greater than 5 will be increased to the nearest round number and with right most digit less than or equal to 5 will be decreased to the nearest round number.

As a part of the program, we will be using the mod (%) operator which gets the right most digit of the number.



import java.util.*;


class RoundOffNumber


{


public static void main(String args[])


{




// Create Scanner object


Scanner s=new Scanner(System.in);





// Read the number


System.out.println("Enter the number");


int n=s.nextInt();




/* Round off the number to nearest 10s */





int r=roundOffTens(n);








// Print the rounded off number


System.out.println("Rounded off to "+r);




}





public static int roundOffTens(int n)


{





// Get the right most digit


int rdigit=n%10;








// If right digit greater than 5


if(rdigit>5)


n+=10-rdigit;





// If right digit <= 5


else


n-=rdigit;





// Return the value


return n;





}





}


Sample outputs of the program




Enter the number


2013


Rounded off to 2010







Enter the number


25


Rounded off to 20







Enter the number


48


Rounded off to 50







Enter the number


0


Rounded off to 0




Explaining the logic of RoundOffNumber

int rdigit=n%10; This is used to get the right most digit of given number. Any number when divided by 10 gives the remainder which is equal to it's right most digit. For a single digit number the number itself is returned.

if(rdigit>5) If the right most digit is greater than 5, then
n+=10-rdigit; By this statement the value of n will become n+10-rdigit; i.e. to the number n, 10-rdigit is added. 10-rdigit gives the number which can be added to n so that the value of n will be increased to the nearest tens. For instance, consider n=48, then we get rdigit as 8 and 10-rdigit as 2. Now n+10-rdigit gives 48+2=50;

else If the right digit is not greater than 5 means it is less than or equal to 5.
n-=rdigit; The value of n will become n-rdigit. The right digit is subtracted from n. Consider 84 we get rdigit as 4 and n-rdigit gives 84-4=80;

In this way, we can round off given number to the nearest tens easily. Feel free to drop a comment.

Spring Framework Check sum of two numbers to target in array

In this i'll be discussing about checking whether any 2 numbers in an array can add up to give a target number. For this, i have written a method which returns an ArrayList<String> which contains the expression that the two numbers can sum up to give the target. The logic is very simple that we need to check every element whether it can sum up with the every other element in the array. Now all those elements which can be summed to the target are added to the ArrayList. See how it works.


import java.util.*;

class TwoCanSum

{

public static void main(String args[])

{



// Create Scanner object

Scanner s=new Scanner(System.in);



// Take no.of elements

System.out.println("Enter the no.of elements");

int n=s.nextInt();



// Create an array of size n

int[] a=new int[n];



// Read the array

System.out.println("Enter the elements");

for(int i=0;i<n;i++)

{

a[i]=s.nextInt();

}



// Enter the target number

System.out.println("Enter the target number");

int target=s.nextInt();



// Check whether any two can sum

ArrayList<String> list=canSum(a,target);



// Get the size, don't call in loop

int size=list.size();



// Print the elements

for(int i=0;i<size;i++)

{

System.out.println(list.get(i));

}





}



public static ArrayList<String> canSum(int[] a,int target)

{

ArrayList<String> list=new ArrayList<String>();



for(int i=0;i<a.length;i++)

{

for(int j=i+1;j<a.length;j++)

{

if(a[i]+a[j]==target) list.add(a[i]+"+"+a[j]+"= "+target);

}

}

return list;

}

}

Sample output of the program


Enter the no.of elements

5

Enter the elements

9

6

7

2

8

Enter the target number

15

9+6= 15

7+8= 15

Explaining the logic of TwoCanSum

ArrayList<String> list=new ArrayList<String>(); Create an ArrayList<String>.

for(int i=0;i<a.length;i++) Loop a.length times where a is the array given as parameter. This loop gets the element at i.

for(int j=i+1;j<a.length;j++) The value of j will be i+1 and this loop is rotated until j equals a.length. When j equals length of the array, the loop breaks. This loop gets every element other than the element at i.

if(a[i]+a[j]==target) Check whether the element at index i and the element at index j sum up to give the target number. Enter the if block if this condition is satisfied else skip if-block.

list.add(a[i]+"+"+a[j]+"= "+target); Add the string which contains the value of the elements which can be summed to the target along with the target number preceded by an =.

Consider 5 elements, then the elements are checked for sum like,

a[0] checked with a[1],a[2],a[3],a[4]
a[1] checked with a[2],a[3],a[4]
......

return list; Returns the array list.

In this way, we can check whether two elements in an array can be summed to give the target number.

Spring Framework Calculate General Term in Java (Binomial Theorem)

Calculating General Term in Binomial Theorem 2 term expansion in Java
This illustrates calculating the general term in a bionomial expansion (x+a)^n using the standard bionomial theorem formula for calculating the general term.

The forumla used is ((nCr)*(x^(n-r))*(a^r))






import java.util.*;

class GeneralTerm

{

    public static void main(String args[])

    {

   

    // Create Scanner object

    Scanner s=new Scanner(System.in);



   

    System.out.println("Enter the values of x,a,n in (x+a)^n");



    // Take values of x,a,n respectively

    int x=s.nextInt();

    int a=s.nextInt();

    int n=s.nextInt();



    System.out.println("Enter the value of r to find general term");



    // Take the value of r

    int r=s.nextInt();





    // To calculate nCr  

    long nCr=calculatenCr(n,r);



      

        // nCr is -1 when n<r

        if(nCr!=-1)

        {

            // Calculate x^(n-r)

            double y=Math.pow((double)x,(double)n-r);



            // Calculate a^r

            double z=Math.pow((double)a,(double)r);



            // Calculate and Print general term ((nCr)*(x^(n-r))*(a^r))

            System.out.println("The result is "+nCr*y*z);

        }      

   

    }





    // Method to calculate nCr

    public static long calculatenCr(int n,int r)

    {



    long res=1;



        if(n>=r)

        {

            res=getFact(n)/(getFact(n-r)*getFact(r));

            return res;

        }

        else return -1;



    }



    public static long getFact(int n)

    {

        long f=1;



        for(int i=n;i>=1;i--)

        {

        f*=i;

        }



    return f;

    }



}

Sample Output



Enter the values of x,a,n in (x+a)^n

5

4

2

Enter the value of r to find general term

2

The result is 16.0




Analysis

nCr=-1: -1 is returned if n<r which is absurd.
nCr!=-1: If n>r then nCr is not equal to -1.
Math.pow((double)x,(double)n-r): This (pow) is a method of java.lang.Math class which takes two double values and find the power. The first parameter is the number and the second one is the power. As x and n-r are long values, they are typecasted into double. This method returns a double value which is the required result. Therefore, x^(n-r) [x to the power n-r] is calculated. Similarily, a^r (a power r) is also calculated.
The General Term:  The general term formula is ((nCr)*(x^(n-r))*(a^r)). The general term is also called as rth term.
Calculating combination: This is discussed in finding number of combinations in Java
Factorial: This is discussed in finding factorial of a number in Java post.

In this way we can calculate the general term in binomial theorem in Java.

Spring Framework Find Number of Combinations in Java

Finding no. of Combinations in Java
This lets you find no. of combinations in java using the standard nCr forumla. This is a simple logic.

The formula of nCr is n!/(n-r)!r!






import java.util.*;
class FindCombination
{
    public static void main(String args[])
    {
    Scanner s=new Scanner(System.in);

    System.out.println("Enter the value of n");
    int n=s.nextInt();
   
   
    System.out.println("Enter the combination suffix (r)");
    int r=s.nextInt();

    long res=1;

        if(n>=r)
        {
            res=getFact(n)/(getFact(n-r)*getFact(r));
            System.out.println("The result is "+res);
        }
        else System.out.println("r cannot be greater than n");
   
    }

    public static long getFact(int n)
    {
        long f=1;

        for(int i=n;i>=1;i--)
        {
        f*=i;
        }

    return f;
    }
}

Sample Output



Enter the value of n
7
Enter the combination suffix (r)
2
The result is 21

Analysis

n>=r: n cannot be greater than the suffix r in a combination.
getFact(n)/(getFact(n-r)*getFact(r)): This is the formula n!/((n-r)!.r!).
getFact() method has been explained in finding the factorial of a number in Java post.

Also see Permuting a number in Java using formula
This is the way in which we can calculate the number of combinations nCr is calculated provided the value of n and r.

Spring Framework Permute Number in Java using Formula

Permutation of a number can be calculated in Java using the standard permutation formula.

The formula for nPr is n!/(n-r)! That is what we are going to use here.





import java.util.*;
class Permute
{
    public static void main(String args[])
    {
    Scanner s=new Scanner(System.in);

    System.out.println("Enter the value of n");
    int n=s.nextInt();
   
   
    System.out.println("Enter the permutation suffix (r)");
    int r=s.nextInt();

    long res=1;

        if(n>=r)
        {
            res=getFact(n)/getFact(n-r);
            System.out.println("The permutation is "+res);
        }
        else System.out.println("r cannot be greater than n");
   
    }

    public static long getFact(int n)
    {
        long f=1;

        for(int i=n;i>=1;i--)
        {
        f*=i;
        }

    return f;
    }
}

Sample Output


Enter the value of n
5
Enter the permutation suffix (r)
2
The permutation is 20



Analysis

n>=r: n cannot be greater than r in case of permuting nPr.
getFact(n)/getFact(n-r): It is nothing but the above formula (n!/(n-r)!).
getFact(int n): The method takes a number and return it's factorial. This is actually discussed in finding the factorial of a number in Java

This is how we can simply permute a number in Java just by knowing the formula.

Spring Framework Finding Factorial of a Number in Java

This illustrates finding factorial of a number algorithm in Java. Here i didn't use any methods for finding factorial, it is just the logic.







import java.util.*;
class FindFactorial
{
    public static void main(String args[])
    {
    int n;
    System.out.println("Enter the number");
    Scanner s=new Scanner(System.in);
    n=s.nextInt();

    // If user enters 0 then 0!=1
    long f=1;

        for(int i=n;i>=1;i--)
        {
        f*=i;
        }
    System.out.println("Factorial of "+n+" is "+f);
    }
}


Sample Output


Enter the number
7
Factorial of 7 is 5040


Analysis

f=1: When user gives 0 as input, then 0!=1
The Loop: Loop is looped till n decreases to 1
f*=i: It is equal to f=f*i;. This is a simple factorial logic.

For people, who don't know what is factorial of a number, i could explain them with the help of examples for a better understand.

5!=5*4*3*2*1=120;

6!=6*5*4*3*2*1=6*(5!)=720;

Also see Finding Divisors of a number in Java

In this way, we can simply find factorial of a number without using any factorial function not only in Java but in any language.

Spring Framework Find Divisors of a Number in Java

This illustrates finding divisors of a number (int) in Java using simple and dead easy logic. Here is the code.








import java.util.*;
class PrintDivisors
{
    public static void main(String args[])
    {

    System.out.println("Enter the number");

    // Create Scanner object for taking input
    Scanner s=new Scanner(System.in);

    // Read an int
    int n=s.nextInt();
   
        // Loop from 1 to 'n'
        for(int i=1;i<=n;i++)
        {
   
            // If remainder is 0 when 'n' is divided by 'i',
            if(n%i==0)
            {
            System.out.print(i+", ");
            }
        }
   
    // Print [not necessary]   
    System.out.print("are divisors of "+n);
   
    }
}


Sample Output



Enter the number
98
1, 2, 7, 14, 49, 98, are divisors of 98



The % symbol is used to find the remainder, the condition here is checked whether the remainder is 0. If the condition is satisfied i.e. if the remainder is 0, then the number is divisible by n. As this is a logic it can be applied not only in Java but other programming languages too for finding the divisors of a given number.

Spring Framework FizzBuzz Program in Java - Interview Question

FizzBuzz: A most famous interview question
Hmm. Let us see the most famous interview question i.e. FizzBuzz. In this post i'll discuss what is FizzBuzz question and how to outsmart this.

What is FizzBuzz?

In this question, you will work with two numbers 3 and 5. The user gives a number as input and then we'll have to get the list of all the numbers starting from 1 till the given number. Now, all we need to do is to find the numbers that are multiples of 3 and 5 and print special words called Fizz and Buzz instead of those multiples respectively. If a number is multiple of both 3 as well as 5 (say 15) FizzBuzz should be printed and if a number is neither a multiple of 3 nor 5 then the number itself is printed. Now let us see how this works.



import java.util.*;
class FizzBuzz
{
    public static void main(String args[])
    {
    Scanner s=new Scanner(System.in);
   
    System.out.println("Enter the number");
   
    int n=s.nextInt();
   
        for(int i=1;i<=n;i++)
        {
            if(i%5==0)
            System.out.println("Buzz");
            else if(i%3==0)
            System.out.println("Fizz");
            else if((i%3==0)&&(i%5==0))
            System.out.println("FizzBuzz");
            else System.out.println(i);
        }
    }
}

Output



Enter the number
15
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
Buzz



Explanation

To know the multiples of a number we'll have to find out the remainder and it should be 0. The same logic is used there.

if(i%5==0) means if a number is multiple of 5 then print Buzz.
if(i%3==0) means if a number is multiple of 3 then print Fizz.
if((i%3==0)&&(i%5==0)) means if a number is multiple of 3 as well as 5, then print FizzBuzz.

That's it, this is a way in which we can outsmart this most famous interview question, the FizzBuzz

Spring Framework Swapping variables without temp variable

Before we have seen how to swap two variables with the use of temp. Now, it's time to see how to swap two variables without the use of a temporary variable. This is just easy if you take a look. It is all simple logic. The example below shows that. It is given with explanation of every statement for a better understand.




import java.util.*;
class SwappingWithoutTemp
{
    public static void main(String args[])
    {
    Scanner s=new Scanner(System.in);

    System.out.println("Enter two numbers");
   
    int a=s.nextInt();
    int b=s.nextInt();

    a=a+b;
    b=a+b;
   
    a=b-a;
    b=-1*(a-b)-a;


    System.out.println("a is "+a+" b is "+b);
    }
}


Sample Output



Enter two numbers
50
40
a is 40 b is 50


Explaining the logic

I think you might be familiar with the basic statements such as reading the input from the user using Scanner class and storing them in variables. Fine, let us move on to the logic.

a=a+b; This statement adds up a and b and then puts it in a.
b=a+b; This statement adds up a and b and then puts it in b. By the time this statement executes the value of a is a+b. So, b=a+b will be equal to original a (the value that user enters into a)+(original b (the value that user enters into b)+(original b (the value that user enters into b)).

a=b-a; This statement subtracts a from the value of b.
By the time this statement executes, the value of b is a-b. So this statement gives, a+b-a which is nothing but b. For a better understand, this is much similar to (a+2b)-(a+b) where a,b are the original(initial) values of a and b i.e. the values that user enters into a and b respectively.

b=-1*(a-b)-a; Consider the sample output case. By the time the values will be,

a=40 since a is made equal to b just before this statement.
b=130 since b=a+b is executed after a=a+b is executed. When a=a+b is executed the value of a will be 90. and when b=a+b is executed the value will be 130 (i.e. a+b+b).
Now, -1*(a-b)-a gives 50 since a-b=-90 (40-130) and -1*(a-b) gives 90 and 90-a is equal to 90-40=50. In this way, we can easily swap variables even without the use of temporary variable. Simple is that. Feel free to drop a comment.

Spring Framework Get item after the array is used up 'n' times

Get item after array used up n times or by n things.
Sometimes we may encounter a question like, if there are 5 colors and every color is picked up by a student in order and if 72 students pick colors in order one after the other, then what is the color picked by 72th student. For such questions there are answers. In this post, i have written an easy logic that could easily be understood which will outsmart this problem.



import java.util.*;
class GetItem
{
    public static void main(String args[])
    {
    Scanner s=new Scanner(System.in);
   
    System.out.println("Enter the no.of colors");
    int n=s.nextInt();

    System.out.println("Enter the array");
   
    String[] st=new String[n];
        for(int i=0;i<st.length;i++)
        {
        st[i]=s.next();
        }

    System.out.println("Enter the student number");
   
    int x=s.nextInt();

    System.out.println("Student number "+x+" will get

"+st[(x%n-1)]);
    }
}



Sample Output


Enter the no.of colors
5
Enter the array
red
green
blue
yellow
magenta
Enter the student number
72
Student number 72 will get green

Explanation

There is in fact only single line of logic to explain. You might however be familiar with java.util.Scanner class and reading values using it. Now, when it comes to the logic, it is very simple. Just divide the student number with the length of the array, the resultant remainder is the position (not index) of the color. As we know that index=position-1 where position of an element in an array represents where it appears. It is just index+1. For instance, red has a position of 1 and index of 0. So first student will pick up red, second student green and so on. Now nth student will pick up n%x positioned element or n%x-1 indexed element.
Carry out the division of 72/5. You will get 2 as remainder and the position of the element is 2 i.e. it's index is 2-1=1.

In this way we can get item after the array after it is reused n times. Feel free to drop a comment.

Spring Framework Get last digit in a number

Getting last digit in a number
Let me illustrate a very simple logic on getting last digit of a number. The logic is applicable on any programming language and not just in Java. As this is a Java demos blog, I am likely to code it in Java.







import java.util.*;
class GetLastDigit
{
    public static void main(String args[])
    {

    Scanner s=new Scanner(System.in);

    System.out.println("Enter the number");
   
    int n=s.nextInt();
   
    System.out.println("The last digit is "+n%10);
    }
}


There is nothing to explain this code. n%10  returns the remainder when the number is divided by 10. That's it. It is obvious that the multiples of 10 end with 0. So the remainder is the last digit. When you want to get all the digits excluding the last digit, simply replace % with / in the above program.Simple is that.

Labels

.equals = operator abstract class abstract method abstract window toolkit Access Modifiers accessing java beans accessing javabeans action events actionperformed active addition Advanced Advanced Overloading AdvJavaBooks Agile development ajax alive AMQP and Android anonymous class anonymous inner class Ant ant tutorials anti patterns antipatterns Apache Camel api for jsp api for servlet api for servlets api jsp application context application scope application session Apps Architecture are you eligible for the ocmjd certificaiton are you eligible for the scjd certification arithmetic operator arpanet array construction array declaration array initialization array list array to list conversion arraylist arraylist of strings arraylist of types arraylist questions arraylists Arrays arrays in java ask for help assert assert in java assertions assertions in java assignment assignment operator Atlassian attribute visibility authentication authorization autoboxing autounboxing awt AWT Event Handling awt interview questions AWT Layouts awt questions awt questions and answers backed collection backed collections Basic Basics of event handling bean attributes bean properties bean scope Beginner best practices BigData blocked books boxing buffer size bufferedreader bufferedwriter business delegate business delegate pattern calendar case statement casting in java casting interview questions chapter review choosing a java locking mechanism choosing a locking mechanism choosing a thread locking mechanism class inside a method class questions class with no name class without a name classes interview questions Clipboard closing jsp tags code snap coding cohesion collection generics collection interview questions collection methods collection of types collection questions collection searching collection types Collections Collections Framework collections interview questions collections sorting colors in java swings colors in swing command line arguments communication between threads comparable comparator comparison operators compiling java classes computers concurrency example and tutorial config Configuration ConnectionPooling constructor creation constructor interview questions constructor overloading constructors in java containers contents of deployment descriptor contents of web.xml context context scope converting array to list converting list to array core java core java interview core java interview question core java interview questions core java questions core java; core java; object oriented programming CoreJava CoreJavaBooks CORS coupling create threads creating 2 dimensional shapes creating 2D shapes creating a frame creating a jframe creating a thread creating an arraylist creating an inner class creating an interface creating java beans creating java threads creating javabeans creating threads creating threads in java CSS cURL currency current thread determination custom tag library custom taglib custom taglibs custom tags CVS dao dao design pattern dao factory pattern dao pattern data access object data access object pattern data structure and algorithm database date and time tutorial date format dateformat dates deadlock deadlocks debugging Declarations decorator pattern decrement default deleting sessions deploy web app deployment deployment descriptor deployment descriptor contents deployment of web application deserialization deserialize design pattern design pattern interview questions design patterns Designpatterns destory method destroy destroying sessions determining current thread determining the current thread Developer Differences different types of collections display stuff in a frame displaying images displaying images in java swings displaying images in swings displaying text in a component division do while loop doget dohead dopost doput DOS Downloads drawing a line drawing an ellipse drawing circles drawing ellipses drawing lines Drools tutorial eBooks Eclipse Eclipse Tutorial Encapsulation encapsulation in java enhanced for loop entity facade pattern enumerations enumerations in java enums equal to equals equals comparison error and exception error codes error handling in servlets error page event handling in swings event listeners exam prep tips example servlet Examples exception exception handling exception handling in servlets exception handling interview questions exception handling questions Exceptions exceptions in java exceptions in web applications explicit locking explicit locking of objects file file navigation filereader filewriter final class final method FireBug first servlet FIX protocol FIX Protocol interview questions FIX protocol tutorial font fonts for each loop for loop form parameters form values formatting forwarding requests frame frame creation frame positioning frame swings front controller front controller design pattern front controller pattern fundamental.Java FXML Games garbage collection garbage collection interview questions garbage collection questions garbage collector gc gc questions general generic Generics generics collections Geo get get set methods getattribute getting bean property getting form values getting form values in servlet getting scwcd certified getting servlet initialization parameters getting sun certified Google Graphics2D gregorian calendar handling strings in java hash hash map hash table hashcode hashmap hashset hashtable head head request HeadFirst heap heaps hibernate hibernate interview questions hibernate interview questions and answers hibernate questions hibernate questions and answers Hibernate Tutorial HibernateBooks homework How To HTML HTML and JavaScript html form http request http request handling http request header http request methods http request servlet http request type http session httprequest httprequest methods httpservlet httpservlet interview questions httpservlet interview questions with answers httpsession httpsession interview questions httpsession questions HttpSessionActivationListener HttpSessionAttributeListener HttpSessionBindingListener if if else if else block if else statement Image IO implementing an interface Implicit objects increment info inheritance inheritance in java init init method Initialization Blocks inner class inner class inside a method inner classes innerclass installation instanceof instanceof operator IntelliJ interaction between threads interface interface interview interface questions interfaces interfaces in java interfaces interview questions internet history interrupting a thread interrupting threads Interview interview questions interview questions on design patterns interview questions on exception handling interview questions on java collections interview questions on serialization introduction to java threads introduction to jsps introduction to threading introduction to threads invalidating session Investment Banking IO Package iscurrentthread iterator J2EE j2ee api j2ee design pattern j2ee design pattern interview questions j2ee design patterns j2ee hibernate interview questions j2ee history j2ee interview j2ee interview questions j2ee mvc j2ee mvc pattern j2ee programmer j2ee questions j2ee servlet api j2ee session j2ee struts interview questions java java 5 tutorial Java 8 java arrays java assertions java assignments java awt questions java bean java bean scope java beans java beginners tutorial Java career java certification Java Class java collection interview questions and answers java collection tutorial java collections java collections interview questions java constructors java currency Java CV java data base connectivity java database connectivity java database connectivity interview questions and answers java dates java design pattern java design patterns java developer certification Java EE java encapsulation java enums java event listeners java exceptions java formatting java garbage collection java garbage collector java gc java heap Java I/O java inheritance java input output Java Interface Java Interview Java Interview Answers Java Interview Questions Java Introduction java io java IO tutorial java iterator java jdbc Java JSON tutorial Java Key Areas java lists java literals java locks nested Java Media Framework java methods java multithreading Java multithreading Tutorials java nested locks java networking tutorial java numbers Java Objects java operators java overloading java parsing Java Programming Tutorials java race conditions java regex java regular expressions Java resume java scjp java searching java serialization java server pages java server pages api java server pages questions java spring interview questions. j2ee spring interview questions java stack java strings java swing java swing event listeners java swing frame java swing images java swings java swings images java thread explicit locking java thread lock scope java thread locking java thread locking mechanism java thread locking objects java threads java threads race condition java tips java tokenizing Java Tools Java Tutorial java ui questions Java Utilities java variables java wrappers Java xml tutorial java.lang java8 javabean javabean accessing javabean scope JavaBeans javac JavaEE JavaFX JavaFX 3D JavaFX 8 JavaOne JavaScript JavaTips JDBC jdbc driver jdbc example jdbc interview questions jdbc interview questions and answers jdbc interview questions with answers jdbc sample code JDBC Tutorial jdbc type 1 driver jdbc type 2 driver jdbc type 3 driver jdbc type 4 driver Jdeveloper JDK JDK8 JEE Tutorial jframe jframe creation jframe position jframe positioning JIRA JMeter JMS JMX join() joining threads JPA JQuery JS JSF JSF Tutorial JSONP JSP jsp and java beans jsp and servlets jsp and xml jsp api jsp code jsp compilation jsp conversion jsp directives jsp error page jsp error page directive jsp implicit objects jsp interview jsp interview questions jsp introduction jsp intvw questions jsp life jsp life cycle jsp life-cycle jsp lifecycle jsp page directive jsp questions jsp sample jsp scripting jsp scriptlets jsp servlets jsp summary jsp synopsis jsp tag libraries jsp tag library jsp taglib jsp tags jsp technology jsp to servlet jsp to servlet conversion jsp translation jsp usage jsp usebean jsp xml tags jsp xml tags usage jsp-servlet jsp:getProperty jsp:setProperty jsp:usebean jsps JSTL JUnit testing keyword synchronized keyword volatile Keywords Lambda Expressions Learning libraries life cycle life cycle of a jsp life cycle of a servlet life cycle of a thread life cycle of jsp life cycle of threads lifecycle of a thread linked list linkedhashmap linkedhashset linkedlist linux List listeners lists Literals locale lock manager pattern lock scope locking objects using threads log Logging logging errors logical and logical operators logical or loops loosely coupled making an arraylist making threads sleep making threads sleep for time MapReduce maps maps usage Maven Maven Tutorial max priority member access method arguments method local inner class method overloading method overriding method return types methods creating classes min priority Miscellaneous mobile mock exam model view controller model view controller design pattern model view controller pattern Multi Threading Multi-threading multiple threads multiplication multithreading multithreading in java multithreading interview questions multithreading questions mvc mvc design pattern mvc pattern MyEclipse mysql nested java lock nested java locks nested java thread locks nested locks nested thread locks NetBeans Networking new news nio NonAccess Modifiers norm priority normal inner class Normalization not equal to Notepad notify notifyall number format numberformat numbers object comparison object notify object orientation object oriented object oriented programming Object Oriented Programming in java objects interview questions ocmjd certification ocmjd certification eligibility OO OO Java oops OpenCSV OpenCV opening jsp tags OpenJDK OpenJFX Operators or Oracle Oracle ADF Mobile Oracle Certified Exams oracle certified master java developer oracle database ORM other topics out overloading overloading constructors overloading in java overriding page page directive page scope parsing passing variables passing variables to methods performance Platform Playing with Numbers points to remember polymorphism positioning a frame post practice exam Primitive Casting primitive variables printwriter priority queue priority queues priorityqueue priorityqueues private processing form values Products programming Projects protected public put questions questions on garbage collection questions on java strings queue quick recap quick review race conditions read objects from stream reading http request header RealTime_Tips redirecting to another servlet redirection reference reference variable casting reference variables Refreshing Java regex Regular Expressions regular inner class relational operators reminder request request dispatcher request forwarding request header request object. httpservletrequest request scope requestdispatcher response RESTClient RESTful retrieving values from session return error codes return types returning values runnable runnable interface running running java programs RUP sample jsp sample questions sample questions scwcd sample servlet scanner Scene Builder scjd certification scjd certification eligibility requirements scjp SCJP Certification scjp exam scjp exam questions scjp exam sample questions scjp questions scjp test scjp test questions scope scope of java locks scope of java thread locks scope of locks scripting in jsp scriptlet tags scriptlets scriptlets in jsp pages scwcd scwcd certification scwcd certification practice exam scwcd exam scwcd exam questions scwcd jsp summary scwcd mock exam scwcd mock exam answers scwcd practice exam scwcd practice test scwcd questions scwcd test SDLC searching searching arrays searching collections searching in java searching treemap searching treesets security self assement self assement scwcd self assessment scjp self test self test scjp self test scwcd send error method senderror method sending error code to browser serialization serialization in java serialization interview questions Serialization on Swing serialization questions service service method servlet servlet and forms servlet and jsp servlet api servlet attributes servlet code servlet container servlet context servlet error handling servlet exception handling servlet handling http request servlet initialization servlet initialization parameters servlet interview servlet interview questions servlet interview questions with answers servlet intvw questions servlet life cycle servlet lifecycle servlet questions servlet questions with answers servlet request servlet request dispatcher servlet request type servlet skeleton servletcontext servletcontextevent servletrequest Servlets servlets and jsps servlets api servlets details servlets request handling session session clean up session event listeners session facade pattern session interview questions session invalidation session listeners session management session questions session scope session timeout session tracking through url rewriting set collections set status method setattribute sets setstatus method setting bean property setting request type short circuit operators Singleton sleep sleeping threads soapUI Software Installation sorting sorting arraylist sorting arrays sorting collections special collections special inner classes split spring spring and hibernate interview questions spring batch Spring Core Spring Framework Spring Integration spring interview questions Spring JDBC Spring MVC Spring security Spring tutorial SQL SQL and database tutorial examples SQL Tutorial SSL stack stacks stacks and heaps static static class static declaration static imports static inner static inner class static method Static variable stopped stopping a thread stopping thread stopping threads Stored Procedure storing values in session Streams strictfp StrictMath string string buffer string builder string class string formatting String Handling string interview questions string manupulation string questions string tokenizer stringbuffer stringbuffer questions stringbuilder Strings strings in java struts Struts 1 Struts 1.2 Struts 2 struts framework interview questions struts interview questions struts interview questions with answers struts mvc interview questions struts questions Struts2 StrutsBooks submitting request subtraction Sun Certification sun certified java developer Sun Certified Java Programmer swing swing action performed swing and colors Swing Components swing event handling swing event listeners swing events Swing Hacks swing images Swing Look And Feels swings swings frame switch block switch case block switch case statement Sybase Sybase and SQL Server synchronization synchronized code synchronized keyword synchronized method System Properties tag lib tag library tag-lib taglibs tags TDD Technical Blogging ternary operator Test Driven Development test scjp Testing the context the session the volatile keyword thread thread class thread deadlocks thread interaction thread interruption thread life cycle thread lifecycle thread lock scope thread locks thread notify thread priorities thread race conditions race conditions in threads thread sleep thread states thread stoppage thread stopping thread synchronization thread syncing thread yield Threads threads in java threads interview questions threads life cycle threads questions tibco tightly coupled tips tips and tricks tips.FXML tokenizing Tomcat Tools toString transitions treemap treeset tricks Tricks Bag try catch try catch finally. finally block Tutorial type casting in java ui programming with java swings UML unboxing unit testing unix url rewriting use bean usebean using a arraylist using collections using colors using colours using command line arguments using different fonts using expressions using font using fonts using fonts in swings using hashmap using http session using httpsession using iterator using java beans in jsp using javabean in jsp using javabeans in jsp using javac using lists using maps using request dispatcher using scriptlets using session persistense using sets using special fonts using system properties using the jsp use bean using treeset using use bean Using Variables using volatile Using Wrappers using xml in jsp Util pack value object value object design pattern value object pattern var-args varargs Variable Arguments Variables vector vector questions vectors visibility vo pattern volatile volatile keyword volatile variables wait method waiting web app exception handling web app interview web application deployment web application exceptions web application scope web application security web component developer web component developer certification web context web context interfaces web context listeners web interview questions web security web server web servers Web services web.xml web.xml deployment webapp log weblogic website hacking website security what are threads what is a java thread what is a thread what is thread while loop windows windows 8 wrapper classes wrappers write objects to stream WSAD xml xml and jsp xml tags xslt yield()