Thursday, January 19, 2017

InterView_Gyan_of_2nd_day

Q1.what is output of this code
public class Assign1 
{
 public static void main(String d[])
 {
 for(int i = 1; i <= 50; i++)
 {
 if(i % (3*5) == 0)
 System.out.println("dil");
 else if(i % 5 == 0)
 System.out.println("pagal");
 else if(i % 3 == 0)
 System.out.println("hai");
 else System.out.println(i);
 }
 }
 }
Q2.how many way access private data member in another class except reflection and getter()and setter()?
Q3.how many way to convert string except using toString()?
Q4.what are different between shallow clonning and deep clonning with example?
Q5.what are main advantage of serialization explain with example?
Q6.How not to serialize any field in class?
Q7.When child class is serialized does parent class get serialized?
Q8.When parent is serialized does child class get serialized?
Q9.How to avoid child class from getting serialized?
Q10.Some system-level classes such as Thread, OutputStream and its subclasses, and Socket are not serializable. ?

Tuesday, January 17, 2017

q.1 print the patterns?

12344321
123**321
12****21
1******1
q.2 print the patterns?
1
2 3 4
5 6 7 8 9
q.3 print the patterns?

1
10
101
1010
10101
q.4 print the patterns?
1    2   3   4   5  6   7   8   9    10
36 37 38 39 40 41 42 43 44   11
35 64 65 66 67 68 69 70 45   12
34 63 84 85 86 87 88 71 46   13
33 62 83 96 97 98 89 72 47   14
32 61 82 95 100 99 90 73 48 15
31 60 81 94 93 92 91 74 49   16
30 59 80 79 78 77 76 75 50   17
29 58 57 56 55 54 53 52 51   18
28 27 26 25 24 23 22 21 20   19
q.5 print the patterns?
5432*
543*1
54*21
5*321
*4321
q.6 print the patterns?

1
121
12321
1234321

q.7 print the patterns?

0
909
89098
7890987
678909876
56789098765
4567890987654
345678909876543
23456789098765432
1234567890987654321
q.8.print the patterns?

1               1
12           21
123       321
1234    4321
1234554321
q.9.print the patterns?
1
232
45654
78910987
q.10.print the patterns?
                         1
                      2 3
                   4 5 6
              7 8 9 10
   11 12 13 14 15




Q. How to design a character triangle shape C program as:

 ABCDE
 ABCD
 ABC
 AB
 A
Q. Write a C program to print the following continues odd reverse number pyramid pattern as:

 1
 6 2
10 7 3
13 11 8 4
15 14 12 9 5

Q. Write a C program to print the following number rhombus pattern design as:

      1 1
     2   2
    3     3
   4       4
  5         5
   4       4
    3     3
     2   2
      1 1

Q. How to print or wap to a E-Shape Pyramid in C language as?

*****
*
***
*
*****

Q. WAP to print M shape pyramid In C language as:

*   *
** **
* * *
*   *
*   *

Q. Write a C program to print a V-Shape Pyramid as:

 *   *
  * *
   *
Q. Write a C program to print the following number triangle pattern as:

0
101
21012
3210123
432101234
54321012345

Q.1 Print the Number Pyramid Pattern as:

  1  2  3  4  5
 15 14 13 12
  6  7  8
 11 10
  9

Q.2 Print the Number Triangle Pattern as:

1
1 2 3
1 2 3 4 5
1 2 3 4 5 6 7
1 2 3 4 5 6 7 8 9

Q.3 Print the Equal Character Triangle as:

A
BAB
CBABC
DCBABCD
EDCBABCDE

Q.4 Print the Equal Number Triangle as:

1
212
32123
43212345
543212345

Q.5 Print the Character Pyramid as:

A
ABA
ABCBA
ABCDCBA
ABCDEDCBA
ABCDEFEDCBA
ABCDEDCBA
ABCDCBA
ABCBA
ABA
A

Q.6 Print the Number Triangle Pattern C program as:

0
101
21012
3210123
432101234
54321012345

Q.7 Continuous Diagonal Number pyramid C program as:

 1
 6 2
10 7 3
13 11 8 6
15 14 12 9 5

Q.8 Design a Number Rhombus Pattern C program as:

            1 1
       2   2
      3     3
     4       4
    5         5
     4       4
      3     3
       2   2
        1 1

Q.9 How To Print E-Shape Pyramid In C:

   *****
   *
   ***
   *
   *****

Q.10 How To Print M-Shape Pyramid In C:

   *   *
   ** **
   * * *
   *   *
   *   *

Q.11 How to print V-Shape pyramid in C as:

   *   *
    * *
     *
Q.12 How to make continuous vertical-horizontal number pyramid as:

 1
 6  2
10  7  3
13 11  8 4
15 14 12 9 5

Q.13 How to print T Shape pyramid in C as:

  *****
    *
    *
    *

Q.14 How to T-Shape Character pyramid as:

 DCBABCD
  CBABC
   BAB
    A

Q.15 How to design a Character pattern as:

  Aa
  Bb Bb
  Cc Cc Cc
  Dd Dd Dd Dd
Q.16 How to make Taj Mahal shape design as:

  *
  ***
  *****
  *******
  **
  ****
  ******
  *******
  ******
  ****
  **
  *******
  *****
  ***
  *

Q.17 How to make a continuous number pyramid with adding increasing zero digit with each row as:

  1
  02
  003
  0004
  00005
  000006
  0000007
  00000008
  000000009

Q.18 How to make half rhombus shape number triangle as:

  5
  456
  34567
  2345678
  123456789
  2345678
  34567
  456
  5

Q.19 Floyd algorithm character pattern as:

  A
  BC
  DEF
  GHIJ
  KLMNO
Q.20 How Print rectangle pattern program in C as:

  1111111
  1222221
  1233321
  1234321
  1233321
  1222221
  1111111

Q.21 Character triangle shape C Program as:

  ABCDE
  ABCD
  ABC
  AB
  A
Q. Print the rectangle pattern program in C as following design:

  1111111
  1222221
  1233321
  1234321
  1233321
  1222221
  1111111

Q. WAP (Write A Program) to making the floyd algorithm character pattern in C as:

  A
  BC
  DEF
  GHIJ
  KLMNO

Q. How to make half rhombus number triangle as:

  5
  456
  34567
  2345678
  123456789
  2345678
  34567
  456
  5

Q. Write a C program to make a continuous number pyramid with adding digit "Zero" as:

  1
  02
  003
  0004
  00005
  000006
  0000007
  00000008
  000000009

Monday, January 16, 2017

java interview gyan by dilip sir

1) Write a Java program to print Fibonacci series?

2) Write a Java program to check if a number is Prime or not?

3) How to Swap two numbers without using temp variable?

4) Difference between String, StringBuffer and StringBuilder in Java?

5) Difference between extends Thread vs implements Runnable in Java?

6) Difference between Runnable and Callable interface in Java?

7) Difference between ArrayList and LinkedList in Java?

8) What is difference between wait and notify and yield in Java?

9) Difference between HashMap and Hashtable in Java?

10) Difference between TreeSet and TreeMap in Java?