Sunday, October 29, 2017

AngularJs

AngularJS extends HTML with ng-directives.
The ng-app directive defines an AngularJS application.
The ng-model directive binds the value of HTML controls (input, select, textarea) to application data.
The ng-bind directive binds application data to the HTML view.

AngularJS starts automatically when the web page has loaded.
The ng-app directive tells AngularJS that the <div> element is the "owner" of an AngularJS application.
The ng-model directive binds the value of the input field to the application variable name.
The ng-bind directive binds the innerHTML of the <p> element to the application variable name.
The ng-init directive initializes AngularJS application variables.
AngularJS expressions are written inside double braces: {{ expression }}.
AngularJS directives are extended HTML attributes with the prefix ng-.
The ng-app directive initializes an AngularJS application.
The ng-init directive initializes application data.
The ng-model directive binds the value of HTML controls (input, select, textarea) to application data.


Friday, October 27, 2017

This keyword

This is a reference variable that refers to the current object.

Usage of java this keyword

Here is given the 6 usage of java this keyword.
  1. this can be used to refer current class instance variable.
  2. this can be used to invoke current class method (implicitly)
  3. this() can be used to invoke current class constructor.
  4. this can be passed as an argument in the method call.
  5. this can be passed as argument in the constructor call.
  6. this can be used to return the current class instance from the method.

this() : to invoke current class constructor

The this() constructor call can be used to invoke the current class constructor. It is used to reuse the constructor. In other words, it is used for constructor chaining.

Sunday, October 22, 2017

sql

CREATE TABLE dbo.Demo(ID INT IDENTITY PRIMARY KEY,
                      IDwithChar AS 'C' + RIGHT('000000' + CAST(ID AS VARCHAR(10)), 6) PERSISTED
                     )

Sunday, October 8, 2017

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container">
  <h2>Rounded Corners</h2>
  <p>The .img-rounded class adds rounded corners to an image (not available in IE8):</p>           
  <img src="p.jpg" class="img-rounded" alt="Cinque Terre" width="304" height="236">   <br>
  <br>
   <img src="p.jpg" class="img-circle" alt="Cinque Terre" width="304" height="236">
   <br><br>
   <br>
   <img src="p.jpg" class="img-thumbnail" alt="Cinque Terre" width="304" height="236">
   =
</div>

</body>
</html>

Friday, October 6, 2017

super keyword in java
The super keyword in java is a reference variable which is used to refer immediate parent class object.
Whenever you create the instance of subclass, an instance of parent class is created implicitly which is referred by super reference variable.
Usage of java super Keyword
  1. super can be used to refer immediate parent class instance variable.
  2. super can be used to invoke immediate parent class method.
  3. super() can be used to invoke immediate parent class constructor.

The final keyword in java is used to restrict the user. The java final keyword can be used in many context. Final can be:
  1. variable
  2. method

  1. class
Java  final variable

If you make any variable as final, you cannot change the value of final variable(It will be constant).


Java final method


If you make any method as final, you cannot override it.

3) Java final class

If you make any class as final, you cannot extend it.


Is final method inherited?

Ans) Yes, final method is inherited but you cannot override it.


Can we declare a constructor final?

No, because constructor is never inherited.

Sunday, August 20, 2017

python part 3

python part 2

python part 2

Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> print("hello")
hello
>>> print("hii prakash")
hii prakash
>>> a=10
>>> print(a)
10
>>> name ="prakash"
>>> print(name)
prakash
>>> b=12.23
>>> print(b)
12.23
>>> a=12
>>> b=23
>>> c=a+b
>>> print(c)
35
>>> c=a-b
>>> print(c)
-11
>>> c=a*b
>>> print(c)
276
>>> c=a/b
>>> print(c)
0.5217391304347826
>>> c=a%b
>>> print(c)
12
>>> prakash=dev=puneet=abhi=akash=virat=tanya=rashi=animesh="BBD"
>>> print(abhi)
BBD
>>> print(animesh)
BBD
>>> print(virat)
BBD
>>> student,fee,father="prakash",12,"father"
>>> print(fee)
12
>>> print(father)
father
>>> 

PYTHON

                            PYTHON
1.open Source language
2.it was developed by Guido van Rossum.

featares of python
1. easy to learn
2. Simple synax
3. Huge nume of laibraries

Python is an object-oriented,
 high level language, interpreted,
 dynamic and multipurpose programming language.

 Python is derived from many other languages,
 including ABC, Modula-3,
 C, C++, Algol-68, SmallTalk, and
 Unix shell and other scripting languages.

Python is copyrighted. Like Perl,
 Python source code is now available
 under the GNU General Public License (GPL).

Video link   VIDEO

Saturday, August 19, 2017

Abstract and Interface

Abstract 

A class that is declared with abstract keyword, is known as abstract class in java. It can have abstract and non-abstract methods (method with body).
Abstraction is a process of hiding the implementation details and showing only functionality to the user.
A class that is declared as abstract is known as abstract class. It needs to be extended and its method implemented. It cannot be instantiated.
abstract class

abstract class A{} 
abstract method

A method that is declared as abstract and does not have implementation is known as abstract method.
Example abstract method

abstract void printStatus();//no body and abstract 
An interface in java is a blueprint of a class. It has static constants and abstract methods.


Interface 

The interface in java is a mechanism to achieve abstraction. There can be only abstract methods in the java interface not method body. It is used to achieve abstraction and multiple inheritance in Java.

Java Interface also represents IS-A relationship.

It cannot be instantiated just like abstract class.

Why use Java interface?

There are mainly three reasons to use interface. They are given below.

It is used to achieve abstraction.
By interface, we can support the functionality of multiple inheritance.
It can be used to achieve loose coupling.


Why multiple inheritance is not supported in java?

To reduce the complexity and simplify the language, multiple inheritance is not supported in java.

Consider a scenario where A, B and C are three classes. The C class inherits A and B classes. If A and B classes have same method and you call it from child class object, there will be ambiguity to call method of A or B class.


Since compile time errors are better than runtime errors, java renders compile time error if you inherit 2 classes. So whether you have same method or different, there will be compile time error now.

interface

abstract method


package javaapplication19;
abstract  class animal{
    abstract void eat();
abstract  void run();
public void body()
{
    System.err.println("two eye and two ear");
}
}
class lion extends animal{
    public void display(){
        System.out.println("king");
    }

    @Override
    void eat() {
        System.err.println("Meat");
    }

    @Override
    void run() {
        System.err.println("fast");
    }
}

class cow extends animal{
    public void display(){
        System.out.println("mother");
    }

    @Override
    void eat() {
        System.err.println("grass");
    }

    @Override
    void run() {
        System.err.println("slow");
    }
}
public class JavaApplication19 {

   
   
   
    public static void main(String[] args) {
       lion obj = new lion();
       obj.body();
       obj.eat();
       obj.display();
       obj.run();
       
       
    }
   
}

INTERFACE

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package javaapplication20;
interface mother{
    void money();
    void dis();
}
class father{
    public void money(){
        System.err.println("10000");
    }
    void disp(){
        System.err.println("m");
    }
}
class son extends father implements mother{
    public void display()
    {
        System.err.println("son");
    }

    @Override
    public void dis() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

   
}
public class JavaApplication20 {

    public static void main(String[] args) {
      son obj = new son();
      obj.money();
    }
   

}

Friday, August 18, 2017

Alphabet Patterns

A                 
AB
ABC
ABCD
ABCDE

E
DE
CDE
BCDE
ABCDE

A
BA
CBA
DCBA
EDCBA


E
ED
EDC
EDCB
EDCBA

ABCDE
ABCD
ABC
AB
A

ABCDE
BCDE
CDE
DE
E

EDCBA
DCBA
CBA
BA
A

E
DD
CCC
BBBB
AAAAA

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


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

Thursday, August 17, 2017

abstract


package javaapplication18;
abstract class animal{
    abstract void eat();
    abstract void run();
    void b(){
       
    }
    abstract  void a();
}
class lion extends animal{
    public void big()
    {
        System.out.println("king");
    }

    @Override
    void eat() {
        System.out.println("Meat");
    }

    @Override
    void run() {
        System.out.println("Fast");
      }

    @Override
    void a() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
}
class cow extends animal{

    @Override
    void eat() {
        }

    @Override
    void run() {
    }

    @Override
    void a() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
   
}

public class JavaApplication18 {
    public static void main(String[] args) {
     

    }
   
}

Wednesday, August 16, 2017

wap accept number and print in word. ex 101 print one hundred one

package javaapplication81;

import java.util.Scanner;

/**
 *
 * @author admin
 */
public class JavaApplication81 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
                            Scanner sc=new Scanner(System.in);
                             String num[]={"one","two","three","four","five","six","seven","eight","nine"}; 
        // TODO code application logic here
                String num1[]={"ten","eleven","twelve","thirteen","fourteen","fifeteen","sixteen","seventeen","eighteen","nineteen"}; 
String num3[]={"ten","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"};        
// TODO code application logic here
    int n; n=sc.nextInt();
     int q,r,c=0,a;a=n;int t,t1,h,h1,i,j,ten,ten1;
                while(n!=0)
                {
                    q=n/10;
                    r=n%10;
                    n=q;
                    c++;
                }
                System.out.println(c);
                if(c==4)
                {
                     t=a/1000;
                     t1=a%1000;
                     h=t1/100;
                     h1=t1%100;
                     ten=h1/10;
                     ten1=h1%10;
                     for(i=1;i<=9;i++)
                     {
                         if(t==i)
                         {
                     System.out.print(num[i-1]+" thousand ");
                }
    }
                      for(i=1;i<=9;i++)
                     {
                         if(h==i)
                         {
                     System.out.print(num[i-1]+" hundred ");
                }
    }
                      if(ten==1)
                      {
                      j=0;
                       for(i=11;i<=19;i++)
                     {
                         if(h1==i)
                         {
                     System.out.print(num1[j]);
                }
                         j++;
                 }
    
                }
                      else
                      {
                         for(i=1;i<=9;i++)
                         {
                             if(ten==i)
                             {
                                 System.out.print(num3[i-1]+" ");
                             }
                         }
                          for(i=1;i<=9;i++)
                         {
                             if(ten1==i)
                             {
                                 System.out.print(num[i-1]);
                             }
                         }
                         
                      }
    }
                 if(c==3)
                {
                    
                     h=a/100;
                     h1=a%100;
                     ten=h1/10;
                     ten1=h1%10;
                     
                      for(i=1;i<=9;i++)
                     {
                         if(h==i)
                         {
                     System.out.print(num[i-1]+" hundred ");
                }
    }
                      if(ten==1)
                      {
                      j=0;
                       for(i=10;i<=19;i++)
                     {
                         if(h1==i)
                         {
                     System.out.print(num1[j]);
                }
                         j++;
                 }
    
                }
                      else
                      {
                         for(i=1;i<=9;i++)
                         {
                             if(ten==i)
                             {
                                 System.out.print(num3[i-1]+" ");
                             }
                         }
                          for(i=1;i<=9;i++)
                         {
                             if(ten1==i)
                             {
                                 System.out.print(num[i-1]);
                             }
                         }
                         
                      }
    }
                  if(c==2)
                {
                     h1=a%100;
                     ten=a/10;
                     ten1=a%10;j=0;
                      for( i=11;i<=19;i++)
    {
        if(h1==i)
        {
                     System.out.print(num1[j]);  System.exit(0);
        }j++;
    }
                     
                         for(i=1;i<=9;i++)
                         {
                             if(ten==i)
                             {
                                 System.out.print(num3[i-1]+" ");
                             }}
                         
                         
                          for(i=1;i<=9;i++)
                         {
                             if(ten1==i)
                             {
                                 System.out.print(num[i-1]);
                             }
                         }
                         
                      }
                  if(c==1)
                  {
                      for(i=1;i<=9;i++)
                      {
                          if(a==i)
                          {
                              System.out.print(num[i-1]);
                          }
                      }
                  }
    
    
    
    
    
    
    }}