Java

ScheduledExecutorService example in Java

Leave a Comment on ScheduledExecutorService example in Java

You can use ScheduledExecutorService to run methods or tasks periodically in java. Check the example below.   import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; public class BeepControlExecutor { public static void main(String[] args) […]

READ MORE

Java

Check an array is a Palindrome in Java

Leave a Comment on Check an array is a Palindrome in Java

A palindrome is a word, number, phrase, or other sequence of characters which reads the same backward as forward. This example show how you are going to check a given array is […]

READ MORE

Java

How to implement an immutable class in Java

Leave a Comment on How to implement an immutable class in Java

  You will need to understand what is immutable type in java. Once you have created an immutable type object you can update or modify it. Below example show how immutable object […]

READ MORE

Android

Android button click event listener

Tagged , , Leave a Comment on Android button click event listener

You need to add a button xml in your layout xml file. Below it is <Button android:id=”@+id/sign_in_button” android:layout_width=”456dp” android:layout_height=”72dp” android:layout_centerHorizontal=”true” android:layout_marginTop=”20dp” android:background=”@drawable/sign_in_btn” android:paddingLeft=”32dp” android:paddingRight=”32dp” /> Now you have to add below code […]

READ MORE

Android / Java

create an Android service

Tagged , Leave a Comment on create an Android service

Today I m going to let you know how to create an Android service through Android app. Lets assume you are developing Android app and you need to start and install a […]

READ MORE

Android / Java

Consume REST Web Service via Android

Leave a Comment on Consume REST Web Service via Android

Lets say you have created an activity called LoginActivity.java You need to import Async task to run a web service call. import android.os.AsyncTask; And inside the controller class you need to create […]

READ MORE

Java

Java Upcasting

Leave a Comment on Java Upcasting

When reference variable of a parent class refers to an object of child class then we call it upcasting. Example is below. Class Bank(){ } Class ComBank extends Bank(){ } Class BankModule(){ […]

READ MORE

Java

Java Static Blocks, Variables and Methods

3 Comments on Java Static Blocks, Variables and Methods

Static Member :- What is a static member ? Static member is a member of a class that which is not interact or associate of  an instance of a class. This can […]

READ MORE

Java

Access Modifiers in Java

14 Comments on Access Modifiers in Java

There are two levels of access modifiers such as top level access and member level access. Top level access This is related to class definition. A class can be public or package-private.

READ MORE

Collections / Java

Hash Map

Leave a Comment on Hash Map

HashMap is one of the most performing data structure in java collection framework. This provides constant time for both insertion and retrieval. This is used for large scale data since this is […]

READ MORE

Java

Abstract Class and Abstract methods in Java 01

Tagged , Leave a Comment on Abstract Class and Abstract methods in Java 01

Abstract class is also a class which is declared as abstract and this cannot be instantiated like normal java class even though it can be sub classed.

READ MORE

Java

Default method in interface in java – part 1

Tagged , 1 Comment on Default method in interface in java – part 1

This default method comes to scene when developers need to update existing interface without updating that interface implement classes updating. Default methods must have to have an implementation.  And developer can update […]

READ MORE

Java

Interfaces in Java – Part 2

Leave a Comment on Interfaces in Java – Part 2

When you define an interface if you make interface public then any class can access it and if you did not use word of public then it will only accessible to classes […]

READ MORE

WP Facebook Auto Publish Powered By : XYZScripts.com