JavaResources--provide free tutorial ebook source fpr you
Join  |  Add Resource  |  Forum  |  About Us  |  Contact Us  |  Policies    
 

 

Hello World Java(Java Tutorial)

Java is powerful programming language and  it is used to develop robust applications. Writing a simple Hello World program is stepwise step. This short example shows how to write first java application and compile and run it. I am assuming that latest version of JDK is installed on your machine

Make cents with BigDecimal (Java Tutorial)

To be able to write Java programs that deal with finances, you need to know about the BigDecimal class and numeric formatting. The first step to teaching you both of those topics is to first create BigDecimal objects.

 
<% int fi=3; CategoryFactory cfy=new CategoryFactory(); ArrayList lists=cfy.getItemsCount(0); Iterator it=lists.iterator(); while(it.hasNext()) { if(fi%3==0) { out.print(" "); } Category cg=(Category)it.next(); out.print(" "); fi++; } %>
Free Tutorial>> Category
"); out.print(""+cg.getItem()+"("+cg.getFlag()+")"); out.print("
<% Format formatter = new SimpleDateFormat("MM/dd/yyyy"); Connection con=DbUtil.getCon(); BusinessObjFactory f=new BusinessObjFactory(){ public Object getBusinessObj(ResultSet rs)throws PagingException{ Vector v=new Vector(); try{ v.add(rs.getString("id")); v.add(rs.getString("item")); v.add(rs.getString("caption")); v.add(rs.getString("count")); v.add(rs.getString("whenmade")); } catch(SQLException ex){ ex.printStackTrace(); throw new PagingException(ex.getMessage()); } return v; } }; out.println("
"); Page p=Page.getPage("select count(a.id) from content a join category b on a.category_id=b.id where b.flag=0 ","select a.id,a.count,a.caption,a.content,a.whenmade,b.item from content a join category b on a.category_id=b.id where b.flag=0 order by a.whenmade desc",con,f,35,request); out.println(p.getPagingHTMLCode("form1")); Iterator itr=p.getData().iterator(); int count=0; out.print(""); %> <% while(itr.hasNext()){ Vector v=(Vector)itr.next(); if(count%2==0) { out.print(""); } else { out.print(""); } count++; out.print("
Category Caption Visits Updated
"+(String)v.elementAt(1)); out.print(""+""+(String)v.elementAt(2)+""); out.print(""+(String)v.elementAt(3)); java.util.Date date=new java.util.Date(Long.parseLong((String)v.elementAt(4))); String s = formatter.format(date); out.print(""+s); } out.println("
"); out.println(p.getPagingHTMLCode("form1")); out.println("
"); con.close(); %>

Copyright @ 2004- 2006  JavaResources. All rights reserved Grupo Publispain