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.