Showing posts with label JAVA J2EE Certification training course in Chennai Struts spring training course in Chennai Thiruvanmiyur T Nagar. Show all posts
Showing posts with label JAVA J2EE Certification training course in Chennai Struts spring training course in Chennai Thiruvanmiyur T Nagar. Show all posts

Friday, 20 December 2013

The Upcoming Scala Concept.

The pragmatist among JVM languages, Scala is a general-purpose programming language. It was conceived and is generally viewed as a “better Java,” and of all alternative JVM languages has the best acceptance in an enterprise setting.

Scala combines the familiar feel of object-oriented Java with strong language support for concurrency, XML and functional programming features: many of the tools that contemporary complex and scalable systems require. Scala also takes a lot of the awkwardness out of Java code, through features such as type inference and traits.
 object HelloWorld {   
 def main(args: Array[String]) {      
println("Hello, World!")    
}  

}

Thursday, 12 December 2013

Multiple exception handling in a single catch block

The earlier versions of java had multiple catch block one after the other where we can handle several exceptions in one try and multiple catch block as follows:

try
{
//do someting;
}
catch(Exception1 e)
{
handleException(e)
}
catch(SQLException e)
{
handleException(e)
}

Java 7 has introduced the new feature of adding multiple exception objects in one catch block as below.

try
{
//do someting;
}
catch(Exception1, Exception2 e)
{
handleException(e)
}

This feature thereby reduces the overhead on the developer .

Friday, 6 December 2013

Function as Argument in Lambda


package com;

The following is an example of how method is implemented by passing the functionitself as an argument.
We have got couple of implementations for the circle interface and they two different operations with respect to context. Those anonymous class implementations itself are passed as argument to another generic method, thus achieving a level of generic function.
public class LambdaFunctionArgument {

  interface Circle {
    double get(double radius);
  }

  public double circleOperation(double radius, Circle c) {
    return c.get(radius);
  }

  public static void main(String args[]){
    LambdaFunctionArgument reference = new LambdaFunctionArgument();
    Circle circleArea = (r) -> Math.PI * r * r;
    Circle circleCircumference = (r) -> 2 * Math.PI * r;
    
    double area = reference.circleOperation(10, circleArea);
    double circumference = reference.circleOperation(10, circleCircumference);
  
    System.out.println("Area: "+area+" . Circumference: "+circumference);
  }
}

Friday, 4 October 2013

Oracle's new cloud services.

Oracle has started several new cloud services today including java as a service.Oracle’s cloud push began in 2011, and since then Oracle has launched several cloud solutions that support more than 25 million cloud users worldwide. Oracle Java Cloud Service and Oracle Database Cloud Service have been Oracle’s most visible PaaS solutions so far. Oracle’s other PaaS offerings are Oracle Developer Cloud Service, Oracle
Storage Cloud Service, and Oracle Messaging Cloud Service. Oracle Developer Cloud Service simplifies development with an automatically provisioned development platform that supports the complete
development lifecycle. Oracle Storage Cloud Service enables businesses to store and manage digital content in the cloud. Oracle Messaging Cloud Service provides an infrastructure that enables communication between software components by sending and receiving messages via a single messaging API, establishing a dynamic, automated business workflow environment.