Friday, 15 February 2013
Paser String to Double:
You can parse a double value in string format to double in 4 ways.
- Double.valueof(String s) : This method returns a double object containing the value invoked in it in string format.
- It can trim white-space in start or end of the string argument, by using String.trim().
- It throws NumberFormatException if the string argument is not in proper form.
- Double.parseDouble(String s) : This method also returns a double instance containing the invoked string value.
- It can also trim white space in start and end of the input value, using String.trim().
- It also throws NumberFormatException if the string argument is not in proper form.
- new Double(String paramString) : You a also parse a string argument containing float value by invoking it on the constructor of the Class Double. its internally using the valueof(String s) method and returns a new Double instance containing the parsed double value. So it is also using
String.trim() and throws NumberFormatException. - Fourth one, the last one is the very important one, actually its been used by all the above 3 APIs. sun.misc.FloatingDecimal.readJavaFormatString(String paramString). Its the original method used to parse a String value to decimal value. This is the actual methods, which is trimming the white space of the string, using String.trim(). It returns value in FloatingDecimal instance, so you need to cast it to double by using doubleValue(), which is another method of Class FloatingDecimal.
Code:
Output:
Friday, 15 February 2013 by Anijit Sarkar · 0 Read more »
Thursday, 14 February 2013
SQL helps to store, manipulate, read and delete data from data base. It helps to performs the CRUD(Create, Read, Update & Delete) operations in RDBMS.
Create: It helps to create database, schema, table and view, along with there properties.
Read: It helps to select all information from single or multiple records from one or many table or view.
Update: It also helps us to manipulates existing data in a database.
Delete: It can also delete information or structure of database or table.
Thursday, 14 February 2013 by Anijit Sarkar · 4 Read more »
Sunday, 10 February 2013
Sunday, 10 February 2013 by Anijit Sarkar · 3 Read more »
Monday, 28 January 2013
Framework:
A framework is a basic conceptual and reusable structure which provides generic functionality, used to solve or address complex issues.
A software framework provides basic architecture, application programming interfaces (APIs) and tools for building application and provides required infrastructure.
Library v/s Framework:
Library: Library or code library is a collection of behavior written is a specific language, which can be used to execute some function. You use it the way you want.
Framework: It controls you. You can’t deviate from the framework rules and create application.
Monday, 28 January 2013 by Anijit Sarkar · 1 Read more »
Sunday, 8 July 2012
- protected void doGet(HttpServletRequest req, HttpServletResponse resp)throws ServletException, java.io.IOException – is a method of Class HttpServlet. It is called by the server (via the service method) to allow a servlet to handle a client's GET request.
- In doGet(), the client’s request parameters are appended to the URL and sent along with header information.
- doGet() is not a secured process because the request parameters are clearly visible in the URL.
- Since request parameters are sent along with header information, so only a limited amount of data should be sent.
Sunday, 8 July 2012 by Anijit Sarkar · 14 Read more »
Popular Posts
-
public - public means everyone can access it.That means it's in global scope. As, main method is called by JVM [ Java Virtual Machine...
-
throw is used to throw an exception in a program, explicitly . Whereas, throws is included in the method's declaration part, wi...
-
Singleton in one of the most popular yet controversial design pattern, in the world of object oriented programming. It's one of t...
-
ORM ( Object Relational Mapping ) is a programming concept of a mapping between Object Oriented Programming and Relational Database ...
-
In Java Programming Language , we must declare a variable name and type, before using it. The data type of a variable defines the th...
-
Web Container / Servlet Container / Servlet Engine : In J2EE Architecture , a web container (also known as servlet container or ser...
-
Vector : It's synchronized. It's slower than ArrayList. It's generally used in ...
-
Program compiles. But at runtime throws an error “NoSuchMethodError”.



