Wednesday 17 February 2016

Lambda Expression in Java 8

Hello Folks,

Today I'm sharing my basic learning to Lambda Expressions.


Lambda Expression

Functional Interfaces: Java 8 intoduced one new Terminology to distinguish interfaces, those intefraces having having only one method.

Lambda Expression are functional only for Functional Interfaces for example Runnable Interface,ActionListener etc.
Lambda used the concept of anonymous inner classes objects.

Syntax of lambda expression

()-> for a single statement

()->{} for multiple line of codes.




Example:

One Line Statement:
public class Runns{
public static void main(String... args){
Runnable r=()->System.out.println("Hi Pratik"); //overriding the one and only method i.e. run
Thread t1=new Thread(r);
t1.start();
}
}

Multiple Line Code:


public class Runns{
public static void main(String... args){
Runnable r=()->{ //overriding the one and only method i.e. run
try{
for(int i=0;i<10;i++){
System.out.println(Thread.currentThread().getName());
Thread.sleep(1000);
}
}
catch(InterruptedException e){
e.printStackTrace();
}
};
Thread t1=new Thread(r,"Nile Thread");
t1.start();
}
}


Here what we did is creation of a anonymous inner class implementing Runnable interface, and handed it over the Thread's object.

As earlier said lambda works on functional interfaces i.e. having only one method, it it does not to worry about multiple methods, it simply overrides the one and only method.



Thank You :)

Wednesday 6 January 2016

Find Columns Name in the MSSQL DataBase

Hello Fellas,

Today I'm sharing the learning to how to find the column whose table name is unknown to us.

here is the query,


select * from INFORMATION_SCHEMA.COLUMNS where COLUMN_NAME like '%TurnAroundTime%' order by TABLE_NAME

Thank You :)

Sunday 3 January 2016

Uninstall Weblogic 12c in Linux

Hello Fellas,

Today I'm sharing my learning to how to uninstall weblogic 12c from ubuntu.

1. Goto this path. Oracle_Home/oui/bin

2. Execute deinstall.sh







Thank You :)

Wednesday 26 August 2015

Apache Tomcat Installation on Linux

Hi Folks,


Today I'm sharing my learning to how to install the Apache Tomcat in linux (Ubuntu).

Download the zip from apache distribution site

extract it using windows or terminal which one is comfortable for you.

open terminal.

type:

gedit .bashrc

enter the following code according to your location where you want to install the apache.





change the modification access and change to +x mode

sudo chmod +x /*.*




command to start server
startup.sh

command to stop server
shutdown.sh


thank you :)

Tuesday 26 May 2015

how to check the jdk version used to compile a .class file

Hi Fellas,

today i'm sharing my learning with you to how to check the jdk version used to compile a .class file.


On Unix/Linux:

javap -verbose MyClass | grep "major"

On Windows:

javap -verbose MyClass | findstr "major"

  • Java 1.2 uses major version 46
  • Java 1.3 uses major version 47
  • Java 1.4 uses major version 48
  • Java 5 uses major version 49
  • Java 6 uses major version 50
  • Java 7 uses major version 51
  • Java 8 uses major version 52
  • Java 9 uses major version 53
  • Java 10 uses major version 54

thank you :)

A Guide to Installing Oracle HR Schema on an Existing Docker Container

  Hi Reader, Today I want to share my learning on how to install Oracle HR schema on a existing docker container. Step 1: Download the verif...