List of methods which present in String class.
1. char charAt(int index)
return character from the specified index...
What is the Difference between Method overloading and Overriding ?
Method Overloading :
Method overloading is the example of compile time polymorphism.
Some of the limitation in Java when...
What is the difference between Error and Exception in Java ?
Error :
It is Generated at compile time and reported by program at compile time only. They are like as missing some of...
Getting started with PrimeFaces.
PrimeFaces is a lightweight library with one jar, zero-configuration and no required dependencies. You just need to download PrimeFaces,...
What is JSF ?
JavaServer Faces (JSF) is a Java-based web application framework intended to simplify development integration of web-based...
How to apply rating bar in android
Step 1 :
Put below code in your layout file :
<RatingBar android:id="@+id/ratingBar" android:layout_width="wrap_content"...
Android back button event with example
Android device back button is to navigate from current activity to previous activity. In that case we are using below code...
Regex Character Classes with example
Regex Character Classes :
[abc] : a,b or c characters only
[^abc] : Any character except a, b or c character.
[a-zA-Z]...
What is regex in Java and How to use it.
Java Regex :
Java Regex and regular expression is an API which define pattern for searching or manipulating strings.
It...
What is Java Bean with Example
Java Bean : Java bean is a class which contains all the properties are private and contains getter/setter methods corresponding...
How to check internet is connected or not in android
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
public class...
Apply css class on html elements using jQuery
$('div').addClass('active');
// here active is the class name which you want to apply on your html page.
// div is the...
Replace html contents using jQuery
$('li').html('New HTML'); // this replaced all list items on your page with specified contents.
$('div').html('New...
What is $(document).ready() ?
What is $(document).ready() ?
Before you can safely use jQuery to do anything to your page, you need to ensure that the...
What do you mean by $ symbol in jQuery ?
jQuery is the library of javascript functions. $ is used for accessing functions which are defined in librar...
eclipse shortcut commands
Click to view shortcut command for eclipse I...
What is thread in Java.
Thread is a program in execution. All Java programs have at least one thread, known as the main thread, which is created...
Explanation of oops concepts
Object means a real word entity such as pen, chair, table etc.Object-Oriented Programming is a methodology or...
How to implement share via option in android
Intent i=new Intent(android.content.Intent.ACTION_SEND);
i.setType("text/plain");
i.putExtra(android.content.Intent.EXTRA_SUBJECT,"Subject...
Android Tab Layout with swipe views
Click here to view cod...
Make phone call using intent in android
1. Add below permission in manifest file :
<uses-permission android:name="android.permission.CALL_PHONE" />
2....
What is jQuery ?
jQuery is JavaScript library which contains predefined methods like show(), hide() etc.
In Javascript we are required...
Prevent from android.os.NetworkOnMainThreadException
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);...
How to load pdf file in your android application
WebView webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setBuiltInZoomControls(true);
webview.loadUrl("https://docs.google.com/gview?embedded=true&url=<PDF_COMPLETE_URL>");
webview.setWebViewClient(new...
Webview in android
WebView is a view that display web pages inside your application. You can also specify HTML string and can show it inside...
How to call another activity in android?
Intent i = new Intent(getApplicationContext(), ActivityTwo.class);
startActivity(i); ...
What is intent?
It is a kind of message or information that is passed to the components. It is used to launch an activity, display a web...
What are the life cycle methods of android activity?
There are 7 life-cycle methods of activity. They are as follows:
onCreate()
onStart()
onResume()
onPause()
onStop()
...
What is Android?
Android is an open-source, linux-based operating system that is used in mobiles, tablets, televisions etc...
Are JVM's platform independent?
JVM's are not platform independent. JVM's are platform specific run time implementation provided by the vendo...
What is a JVM?
JVM is Java Virtual Machine which is a run time environment for the compiled java class file...
How to create PATH and JAVA_HOME environment variables from command prompt (cmd)
>setx JAVA_HOME "C:\Program Files\Java\jdk1.8.0"
>setx PATH "%PATH%;%JAVA_HOME%\bin...
Java 7 Features
1. Strings in Switch:
public void testStringInSwitch(String param){
final String JAVA5 = "Java...
Difference between path band classpath in Java
1).Path is an environment variable which is used by the operating system to find the executables.
Classpath is an environment...
Random String Generation in Java
import java.util.Random;
public class RandomStringGen {
private static final String CHAR_LIST =
...
Run task periodically in Java
Schedular Task :
For this functionality,
You should create a class extending TimerTask(available in java.util package)....
Subscribe to:
Posts (Atom)