Posts

Java 8 features

Language-level support for lambda expressions; unofficially under Project Lambda Default methods (virtual extension methods) which make multiple inheritance possible in Java. a JavaScript runtime which allows developers to embed JavaScript code within applications. Annotation on Java Types. Unsigned Integer Arithmetic. Repeating annotations. Date and Time API. Statically-linked JNI libraries. Launch JavaFx applications. These are the features currently added into java 8,which has features as that of java 7 and also is a little bit advanced one.Java 7 is no longer available to download from it parent site(Oracle(dot)com). web development company in bangalore

Serialization and deserialization in Java

In Java Object Serialization is implemented with the help of ObjectInput and ObjectOutput interfaces, which extends DataInput and DataOutput interfaces, respectively. ObjectOutputStream class and the ObjectInputStream class implement the ObjectOutput interface and the ObjectInput interface, respectively. These two classes provides some set of methods which helps in writing and reading binary form of Object and Primitive values (int,long,double etc.). Serialization  is a process of converting an object into a sequence of bytes which can be persisted to a disk or database or can be sent through streams. The reverse process of creating object from sequence of bytes is called  deserialization . This process are mainly implemented by  web design company in bangalore

A comparison on Android Studio and Eclipse IDE for android development

Build Tools Android Studio utilizes the fast growing Gradle build system. It builds on top of the concepts of Apache Ant and Apache Maven but it also introduces a Groovy DSL (Domain-Specific Language) that allows for scripted builds which opens up many automation possibilities like uploading your beta .apk to TestFlight for testing. Eclipse on the other hand uses Apache Ant as its main build system which a very robust XML based build system that many Java developers may already be familiar with. Advanced Code Completion/Refactoring Both IDEs feature the standard Java code auto completion but in the case of Android Studio, Google has baked in deeper support for specific Android code and refactoring. Android Studio can refactor your code in places where it’s just not possible using Eclipse and ADT. In addition, in my opinion IntelliJ’s Java auto completion seems more “intelligent” and predicts better what I want to do so there is definitely an improvement in this area over Eclips...

Collections - Queue

Collections - Queue The java.util.Queue is a subtype of java.util.Collection interface. It is an ordered list of objects with its use limited to inserting elements at the end of list and deleting elements from the start of list i.e. it follows FIFO principle. Since it is an interface, we need a concrete class during its declaration. There are many ways to initialize a Queue object, most common being- As a Priority Queue As a LinkedList Please note that both the implementations are not thread safe. PriorityBlockingQueue is one alternative implementation if you need a thread safe implementation. Operations on Queue : Add()- Adds an element at the tail of queue. More specifically, at the last of linkedlist if it is used, or according to the priority in case of priority queue implementation. peek()- To view the head of queue without removing it. Returns null if queue is empty. element()- Similar to peek(). Throws NoSuchElementException if queue is empty. remove()- Removes...

Collections in Java -ArrayList

ArrayList in java  Arraylist  class implements List interface. It is widely used because of the functionality and flexibility it offers. Most of the developers  choose Arraylist over Array  as it’s a very good alternative of traditional java arrays. ArrayList is a resizable-array implementation of the  List  interface. It implements all optional list operations, and permits all elements, including  null . The issue with arrays is that they are of fixed length so if it is full you cannot add any more elements to it, likewise if there are number of elements gets removed from it the memory consumption would be the same as it doesn’t shrink. On the other ArrayList can dynamically grow and shrink after addition and removal of elements. Apart from these benefits ArrayList class enables us to use predefined methods of it which makes our task easy. Let’s see the ArrayList example first then we will discuss it’s methods and their usage. These are the main...

Java - Basic Syntax

When we consider a Java program, it can be defined as a collection of objects that communicate via invoking each other's methods. Let us now briefly look into what do class, object, methods, and instance variables mean. Object  − Objects have states and behaviors. Example: A dog has states - color, name, breed as well as behavior such as wagging their tail, barking, eating. An object is an instance of a class. Class  − A class can be defined as a template/blueprint that describes the behavior/state that the object of its type supports. Methods  − A method is basically a behavior. A class can contain many methods. It is in methods where the logics are written, data is manipulated and all the actions are executed. Instance Variables  − Each object has its unique set of instance variables. An object's state is created by the values assigned to these instance variables. This tutorials are made from best web development company in Bangalore .

Java tutorials

Java environment setup Local Environment Setup If you are still willing to set up your environment for Java programming language, then this section guides you on how to download and set up Java on your machine. Following are the steps to set up the environment. Java SE is freely available from Oracle website. You can download a version based on your operating system.Only the latest version of java would be freely available from oracle website. Follow the instructions to download Java and run the  .exe  to install Java on your machine. Once you installed Java on your machine, you will need to set environment variables to point to correct installation directories − Setting Up the Path for Windows Assuming you have installed Java in  c:\Program Files\java\jdk  directory − Right-click on 'My Computer' and select 'Properties'. Click the 'Environment variables' button under the 'Advanced' tab. Now, alter the 'Path' variable so that it...