Step 1: Download Java – Decompiler from
http://download.cnet.com/windows/3055-2213_4-10046809.html?tag=pdl-redir
Step 2: Install the Java – Decompiler in your PC.
Step 3: Go to All Programs –> DJ Java Decomplier –> DJ Java Decomplier.
Step 4: Select File –> Open then Choose the Class File in File Dialog box.

Step 5: Java File is created from class File.

Popularity: 4% [?]
Combination of java and JDBC is very useful to lets the programmer run his/her program on different platforms. Java programs are secure, robust, automatically downloaded from the network.JDBC API enables Java applications to interact with different types of databases.
Some of the advantages of using Java with JDBC are
• Easy and economical
• Continued usage of already installed databases
• Development time is short
• Installation and version control simplified
JDBC does the following three things
• Establish connection with a database
• Send SQL statements
• Process the results
Popularity: 1% [?]
Network is nothing but a set of computers which are physically connected together.internet is a network of networks.
Protocols:
Different networks requires certain set of rules called protocols.java networking is done using TCP/IP protocol
Different types of protocols are also available in this protocol they are:
*Http(Hyper Text Transfer Protocol)
*FTP(File Transfer Protocol)
*SMTP(Simple Mail Transfer Protocol)
*NNTP(Network News Transfer Protocol)
Sockets:
Sockets is used to plug in just like a electronic sockets.it is essential that they should follow a set of rules to communicate called protocols.
TCP/IP as protocol for communication and IP addresses are the address of the sockets.
Client/Server:
A computer request some service from another computer,is called a client.one that processes the request is called server.A server waits till one of its clients makes a request.it can accept multiple connections at a time.Multi-threading is used to serve multiple users at the same time.
Internet Addresses:
Every computer are connected to a network has a unique IP address.An IP address is a 32-bit number which has four numbers separate by periods.it is possible to connect to the Internet either directly or by using internet service provider.By connecting directly to the internet,the computer is assigned with a permanent IP address.
InetAddress:
InetAddress is one class,which is used to encapsulate th IP address and the DNS.to create a instance of InetAddress class,factory methods are used as there are no visible constructors available for this class.
Methods:
static InetAddress getLocalHost()
//Returns InetAddress object representing local host
static InetAddress getByName(String hostname)
//Returns InetAddress for the host passed to it.
Popularity: 2% [?]
Threads:
Thread is a line of execution.In a single-threaded system there is only one execution line (i.e) only one part of program is in the process of execution at any one time
To create a new thread:
Thread mythread = new thread(this);
this referes the current applet & mythread is a variable
Example:
import java.awt.*;
import java.applet.Applet;
public class MovingBall extends Applet implements runnable
{
Thread mythread=null;
int position=0;
public void start()
{
mythread=new Thread(this);
mythread.start();
}
public void run()
{
while(true)
{
for(position=0;position) {
repaint();
try
{mythread.sleep(100);
}
catch(InterruptedException e)
{
}
}
}
}
public void stop()
{
mythread.stop();
mythread = null;
}
public void paint(Graphics g)
{
g.setColor(Color.gray);
g.fillOval(position,50,30,30);
g.setColor(Color.black);
g.fillOval(position+6,58,5,5);
g.fillOval(position+20,58,5,5);
g.drawLine(position+15,58, position+15,68);
g.drawLine(position+12,68, position+15,68);
g.drawLine(position,45,30,30,-50,-70);
}
}
Popularity: 6% [?]
Requirements for JavaBeans:
- there have to be set/get methods specified
- has to have public default constructor (without parameters)
- it should be in a package
- serializable
- get/set methods has to have the same data type!
- bean cannot modify content of a page!
… in general, JavaBean is a standard Class.
It can be used as a simple component in a JSP page.
- get method has to be fast, and it should be plain and simple.
usage in a JSP page:
<jsp:useBean id=”nameOfBean” scope=”session” class=”myPackage.Counter”>
<jsp:setProperty name=”nameOfBean” property=”myCount”>
this is the same as
<%= Counter.myCount %>
with JSTL Expression language:
<c:out value=”${Counter.myCount}”>
automatically set the bean attributes from names (!important!):
<jsp:setProperty name=”pocetMiest” property=”*”>
Scope can be:
- application - the bean is available in all application, when that’s in more JSP pages, one of them can create it once and other JSP pages can use it. It’s something like a global object for all application.
- session - stored data, just for this session
- request - just for request or forward
- page - smallest scope, just on a page that is called (forwarded or included)
Popularity: 1% [?]
December 22nd, 2008
admin
How to Open a File in Different Format
1.Create a HTML Page or JSP Page
2.Insert <%@ page contentType=”application/vnd.ms-excel” %> instead of <%@ page contentType=”application/html” %> in HTML Page or JSP Page
3.Open a File,Now its open in a Excel Sheet with Style apply in the Sheet.
For Microsoft Word
<%@ page contentType=”application/vnd.msword” %>
For PDF File
<%@ page contentType=”application/vnd.pdf” %>
For Wordpad
<%@ page contentType=”application/vnd.rtf” %>
For Microsoft Powerpoint
<%@ page contentType=”application/vnd.ms-powerpoint” %>
For Winzip
<%@ page contentType=”application/vnd.zip” %>
Popularity: 2% [?]
November 25th, 2008
admin
The StringTokenizer class allows an application to break a string into tokens. The tokenization method is much simpler than the one used by the StreamTokenizer class. The StringTokenizer do not distinguish among identifiers, numbers, and quoted strings, nor do they recognize and skip comments.
The set of delimiters (the characters that separate tokens) may be specified either at creation time or on a per-token basis.
An instance of StringTokenizer behaves in one of two ways, depending on whether it was created with the returnDelims having the value True or False :
- If the flag is Flase
, delimiter characters serve to separate tokens. A token is a maximal sequence of consecutive characters that are not delimiters.
- If the flag is True
, delimiter characters are themselves considered to be tokens. A token is thus either one delimiter character, or a maximal sequence of consecutive characters that are not delimiters.
A StringTokenizer object internally maintains a current position within the string to be tokenized. Some operations advance this current position past the characters processed.
A token is returned by taking a substring of the string that was used to create the StringTokenizer object.
Example without Delimiter:-
StringTokenizer st = new StringTokenizer(“Example Of String Tokenizer”);
while (st.hasMoreTokens()) {
System.out.println(st.nextToken());
}
Output
=====
Example
of
String
Tokenizer
Example with Delimiter:-
StringTokenizer st = new StringTokenizer(“1$2$3$4″,”$”);
while (st.hasMoreTokens()) {
System.out.println(st.nextToken());
}
Output
=====
1
2
3
4
Popularity: 2% [?]
November 16th, 2008
admin
Open a File in Runtime in Java:
1.Create a Object For Process
2.exec is a method to open a File in Runtime
3.In the exec Method, we can give all the command which can be give in the Run Window
Process process=Runtime.getRuntime().exec(“notepad d:\demo.txt”);
4.If it cannot Work,Copy Exe File and Paste it in C:\Windows\System32
Popularity: 1% [?]
November 14th, 2008
admin
The if tag allows the conditional execution of its body according to the value of the test attribute
<c:if test=”${not empty details.add}”>
It is Not a Empty ArrayList
</c:if>
<c:if test=”${empty details.add}”>
It is a Empty ArrayList
</c:if>
The choose tag performs conditional block execution by the embedded when subtags. It renders the body of the first when tag whose test condition evaluates to true. If none of the test conditions of nested when tags evaluates to true, then the body of an otherwise tag is evaluated, if present.
<c:choose>
<c:when test=”${bank.account== ’saving’}”>
Saving Account
</c:when>
<c:when test=”${bank.account == ‘RD’}”>
RD Account
</c:when>
<c:when test=”${bank.account == ’salary’}”>
Salary Account
</c:when>
<c:otherwise>
…
</c:otherwise>
</c:choose>
Popularity: 1% [?]