What is the Difference between Method overloading and Overriding ?

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 we are declare the method within the class. We can't declare two methods in a class which have same name and signature and parameters.

So that we can overload such method by following process :

We can use same method name for both the methods but we are required to pass the parameters different to those methods.

It depends on type of argument, No. of argument, Sequence of argument.


Method Overriding :

Method overriding is performed in such case when we have two different classes and they are linked each other through Inheritance.

Both the classes contains method which have same name, signature and Argument.
What is the difference between Error and Exception in Java ?

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 the symbols which are required as per java programming.

Some of the statement which are showing declaration error, missing semicolon (;) error etc.


Exception : 

If the error which is generated at the time of run time which is called Exception. Exception are not the programming error. They generated due to input provided at run time and depends on the inputs only.

If sometime we can see the FileNotFoundException which is generated at run time because compile time doesn't check the content which we provided to program.
Getting started with PrimeFaces.

Getting started with PrimeFaces.

PrimeFaces is a lightweight library with one jar, zero-configuration and no required dependencies. You just need to download PrimeFaces, add the primefaces-{version}.jar to your classpath and import the namespace to get started.


  1. <html xmlns="http://www.w3.org/1999/xhtml"  
  2.     xmlns:h="http://java.sun.com/jsf/html"  
  3.     xmlns:f="http://java.sun.com/jsf/core"  
  4.     xmlns:p="http://primefaces.org/ui">  
  5.   
  6.     <h:head>  
  7.   
  8.     </h:head>  
  9.       
  10.     <h:body>  
  11.       
  12.         <p:spinner />  
  13.           
  14.     </h:body>  
  15. </html>  
What is JSF ?

What is JSF ?

JavaServer Faces (JSF) is a Java-based web application framework intended to simplify development integration of web-based user interfaces. JavaServer Faces is a standardized display technology which was formalized in a specification through the JavaCommunity Process.
How to apply rating bar in android

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:layout_height="wrap_content"    android:layout_gravity="center"    android:numStars="5"    android:progressTint="@android:color/holo_orange_light"    android:layout_marginTop="10dp"    android:stepSize="1.0"    android:rating="0" />


here define the components which we are used :

ratingBar - id of RatinBar Component.

numStars - how many starts which you show for rating

progressTint  - Color of starts when we select for rating.

stepSize - when we click one time how may count we measure.

rating  - initial rating which we show on rating bar.


When we are using this RatingBar in Activity class so following methods are useful.

setRating - for any rating.

getRating  - get the current rating from the RatingBar.