<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7464055709054203132</id><updated>2011-07-31T18:01:07.705+07:00</updated><category term='Project'/><category term='Netbeans'/><category term='Tutorial'/><category term='Guide'/><category term='Java'/><category term='Certification'/><category term='Database'/><category term='News'/><category term='Ajax'/><title type='text'>Smart Person Uses "Java"</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://project-java.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://project-java.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Son Rokhaniawan Perdata, S.T</name><uri>http://www.blogger.com/profile/17482607511048653600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_3PrCZQCxHao/SVJnUM5McbI/AAAAAAAAAHQ/4WvrWg1K28o/S220/son.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7464055709054203132.post-1488887792119768088</id><published>2010-01-20T14:15:00.002+07:00</published><updated>2010-01-20T14:18:35.977+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Project'/><category scheme='http://www.blogger.com/atom/ns#' term='Netbeans'/><title type='text'>Calculator dengan Java - NetBeans</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bariskode.web.id/wp-content/uploads/2009/08/calculator.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 327px; height: 262px;" src="http://bariskode.web.id/wp-content/uploads/2009/08/calculator.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Bagi yang pengen membuat calculator dengan menggunakan bahasa java silahkan download sorce code nya &lt;a href="http://www.ziddu.com/download/8242962/calculator.rar.html"&gt;disini&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;http://www.ziddu.com/download/8242962/calculator.rar.html&lt;br /&gt;&lt;br /&gt;Aplikasi ini dibuat dengan menggunakan NetBeans.&lt;br /&gt;Selamat Berkreasi&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7464055709054203132-1488887792119768088?l=project-java.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://project-java.blogspot.com/feeds/1488887792119768088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://project-java.blogspot.com/2010/01/calculator-dengan-java-netbeans.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/1488887792119768088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/1488887792119768088'/><link rel='alternate' type='text/html' href='http://project-java.blogspot.com/2010/01/calculator-dengan-java-netbeans.html' title='Calculator dengan Java - NetBeans'/><author><name>Son Rokhaniawan Perdata, S.T</name><uri>http://www.blogger.com/profile/17482607511048653600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_3PrCZQCxHao/SVJnUM5McbI/AAAAAAAAAHQ/4WvrWg1K28o/S220/son.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7464055709054203132.post-5356804727759098694</id><published>2010-01-16T10:25:00.002+07:00</published><updated>2010-01-16T10:54:32.354+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Netbeans'/><title type='text'>Java and MySQL Store Prosedure Programming I</title><content type='html'>&lt;p&gt;&lt;span style="color: rgb(64, 64, 64); font-weight: normal;"&gt;Pada DBMS MySQL ada sebuah service dimana kita dapat membuat sebuah prosedur tersimpan di MySQL sendiri serta menjalankan prosedure tersebut kapan sesuai keinginan kita.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;Ketika mata kuliah &lt;span style="font-family:arial,helvetica,sans-serif;"&gt;PBO. Aku sering &lt;/span&gt;mengamati dosen-dosen mengajarkan tentang koneksi Java ke MySQL. Dan pertanyaanku, mengapa sintaq SQL selalu diketik di list program java? mengapa tidak di tulis di MySQL sendiri?&lt;/p&gt;      &lt;p&gt;Jadi kita bisa memisahkan pemrograman Java dan pemrograman MySQL sendiri-sendiri.&lt;/p&gt; &lt;p&gt;&lt;img src="http://hmti.dinus.ac.id/images/Java_MySQL_SP/java_mysql_sp1.png" /&gt;&lt;/p&gt; &lt;p&gt;di atas adalah uraian singkat dari store prosedure.&lt;/p&gt; &lt;p&gt;*&gt;&gt;Ok. kita masuk ke MySQL. Bagaimana cara membuat sebuah store prosedure dengan parameter inputan.&lt;/p&gt;  &lt;div style="font-style: italic;" id="_mcePaste"&gt;&lt;span style="font-family:'courier new',courier;"&gt;CREATE &lt;/span&gt;&lt;span style="font-family:'courier new',courier;"&gt;PROCEDURE&lt;/span&gt;&lt;span style="font-family:'courier new',courier;"&gt; SP_InputBarang&lt;/span&gt;&lt;/div&gt; &lt;div style="font-style: italic;"&gt;&lt;span style="font-family:'courier new',courier;"&gt;(kd char(5),nama varchar(30),hrgbeli double,diskon double,&lt;/span&gt;&lt;/div&gt; &lt;div style="font-style: italic;"&gt;&lt;span style="font-family:'courier new',courier;"&gt;hrgprivate double,hrgjual double,stock int)&lt;/span&gt;&lt;/div&gt; &lt;div style="font-style: italic;" id="_mcePaste"&gt;&lt;span style="font-family:'courier new',courier;"&gt;begin&lt;/span&gt;&lt;/div&gt; &lt;div style="font-style: italic;" id="_mcePaste"&gt;&lt;span style="font-family:'courier new',courier;"&gt;insert into T_Barang values(kd,nama,hrgbeli,diskon,hrgprivate,&lt;/span&gt;&lt;/div&gt; &lt;div style="font-style: italic;" id="_mcePaste"&gt;&lt;span style="font-family:'courier new',courier;"&gt;hrgjual,stock);&lt;/span&gt;&lt;/div&gt; &lt;div id="_mcePaste"&gt;&lt;span style="font-family:'courier new',courier;"&gt;&lt;span style="font-style: italic;"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;maksud sintaq SQL di atas:&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;create procedure [nama prosedur]  ==&gt; membuat prosedur&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;([nama parameter] [type variable])  ==&gt; membuat parameter inputan&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;begin&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;[sintaq SQL, misal input,delete,atau kondisi]&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;end&lt;/span&gt;&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;silakan compile sintaq sql tersebut di MySQL anda.&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;*&gt;&gt; Selanjutnya kita buka netbeans. kalau belum punya bisa download di &lt;a target="_parent" href="http://netbeans.org/"&gt;netbeas.org&lt;/a&gt;&lt;/div&gt; &lt;p&gt;Buatlah sebuah Form seperti pada gambar di bawah.&lt;/p&gt; &lt;p&gt;&lt;img src="http://hmti.dinus.ac.id/images/Java_MySQL_SP/f_input.png" /&gt;&lt;/p&gt; &lt;p&gt;*&gt;&gt;pertama kita import libary jdbc MySQL.&lt;/p&gt; &lt;p&gt;masuk ke halaman source&lt;/p&gt; &lt;p&gt;setelah itu ketik pada awal program.&lt;/p&gt; &lt;p&gt; &lt;/p&gt;  &lt;p style="font-style: italic;"&gt;&lt;span style="font-family:'courier new',courier;"&gt;import java.sql.*;&lt;br /&gt;import javax.swing.JOptionPane;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;*&gt;&gt;lanjut......pada "Public F_input" silakan di ketik code di bawah.(F_Input adalah nama class yang kalian buat)&lt;/p&gt; &lt;div&gt;              &lt;p style="font-style: italic;"&gt;&lt;span style="font-family:'courier new',courier;"&gt;public F_input() {&lt;br /&gt;initComponents();&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;//meload driver&lt;br /&gt;Class.forName("com.mysql.jdbc.Driver");&lt;br /&gt;//membuat koneksi&lt;br /&gt;conn=DriverManager.getConnection("jdbc:mysql://locahost/db","root","");&lt;br /&gt;}&lt;br /&gt;catch(Exception e)&lt;br /&gt;{&lt;br /&gt;JOptionPane.showMessageDialog(null, e);&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt; &lt;p&gt;*&gt;&gt;Mari kita buat sebuah method dengan nama "masukan_data" seperti code di bawah.&lt;/p&gt;                 &lt;p&gt; &lt;span style="font-family:'courier new',courier;"&gt;    &lt;span style="font-style: italic;"&gt;void masukan_data(){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;try{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;CallableStatement sp_inputbarang =&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;conn.prepareCall("{call SP_InputBarang(?,?,?,?,?,?,?)}");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;sp_inputbarang.setString(1, txtkodebarang.getText());&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;sp_inputbarang.setString(2, txtnama.getText());&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;sp_inputbarang.setDouble(3, Double.parseDouble(txthargabeli.getText()));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;sp_inputbarang.setDouble(4, Double.parseDouble(txtdiskon.getText()));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;sp_inputbarang.setDouble(5, Double.parseDouble(txthargaprivate.getText()));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;sp_inputbarang.setDouble(6, Double.parseDouble(txthargajual.getText()));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;sp_inputbarang.setInt(7, Integer.parseInt(txtstock.getText()));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;sp_inputbarang.execute();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;JOptionPane.showMessageDialog(null, "Simpan data berhasil");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;}catch(Exception e){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;JOptionPane.showMessageDialog(null, e);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;*&gt;&gt; Buat Method Kosong untuk mengosongkan textField.&lt;/span&gt;&lt;/p&gt;          &lt;p&gt;&lt;span style="font-family:'courier new',courier;"&gt;    &lt;span style="font-style: italic;"&gt;void kosong()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;txtkodebarang.setText("");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;txtnama.setText("");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;txthargabeli.setText("");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;txtdiskon.setText("");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;txthargaprivate.setText("");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;txthargajual.setText("");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;txtstock.setText("");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;*&gt;&gt; Klik Kanan pada textField Diskon--&gt;Events--&gt;Focus--&gt;FocusLost. Dan Ketikkan code di bawah.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt; &lt;/span&gt;&lt;/p&gt;      &lt;p&gt;&lt;span style="font-family:'courier new',courier;"&gt;    &lt;span style="font-style: italic;"&gt;private void txtdiskonFocusLost(java.awt.event.FocusEvent evt) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;double hargabeli = Double.parseDouble(txthargabeli.getText());&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;double diskon = Double.parseDouble(txtdiskon.getText());&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;double hargaprivate = (hargabeli - (hargabeli * (diskon/100)));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;txthargaprivate.setText(""+hargaprivate);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:'courier new',courier;"&gt;&lt;img src="http://hmti.dinus.ac.id/images/Java_MySQL_SP/txtdiskon_lostfokus.png" /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;*&gt;&gt; Klik Kanan pada button Save--&gt;Action--&gt;ActionPerformed. Dan Ketik code di bawah.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt; &lt;/span&gt;&lt;/p&gt;    &lt;p&gt;&lt;span style="font-family:'courier new',courier;"&gt;    &lt;span style="font-style: italic;"&gt;private void btsaveActionPerformed(java.awt.event.ActionEvent evt) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;masukan_data();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;kosong();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;*&gt;&gt; Begitu juga pada button Cancel.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt; &lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:'courier new',courier;"&gt;    &lt;span style="font-style: italic;"&gt;private void btcancelActionPerformed(java.awt.event.ActionEvent evt) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;kosong();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;*&gt;&gt;Dan pada button Close.&lt;/p&gt; &lt;p&gt; &lt;/p&gt;   &lt;p&gt;&lt;span style="font-family:'courier new',courier;"&gt;    &lt;span style="font-style: italic;"&gt;private void btcloseActionPerformed(java.awt.event.ActionEvent evt) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;dispose();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;untuk lebih jelasnya bisa download source code &lt;a href="http://hmti.dinus.ac.id/index.php/download/category/2-java-mysql-store-prosedure?download=2%3Ajava-mysql-storeprosedure"&gt;di sini&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;cara penggunaan :&lt;/p&gt; &lt;ol&gt;&lt;li&gt;file mysql.sql di import dari SQLYog. (SQLYog bisa didownload &lt;a href="http://www.webyog.com/"&gt;di sini&lt;/a&gt;)&lt;/li&gt;&lt;li&gt;folder test_StoreProsedure open lewat Netbeans.&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;  &lt;p style="text-align: center;"&gt;&lt;strong&gt;!!!---SELAMAT BEREKSPERIMEN---!!!&lt;/strong&gt;&lt;/p&gt;&lt;a href="http://hmti.dinus.ac.id/index.php/informasi/artike/31-komputer/49-java-mysql-store-prosedure-programming1"&gt;Sumber&lt;/a&gt;&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7464055709054203132-5356804727759098694?l=project-java.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://project-java.blogspot.com/feeds/5356804727759098694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://project-java.blogspot.com/2010/01/java-and-mysql-store-prosedure.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/5356804727759098694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/5356804727759098694'/><link rel='alternate' type='text/html' href='http://project-java.blogspot.com/2010/01/java-and-mysql-store-prosedure.html' title='Java and MySQL Store Prosedure Programming I'/><author><name>Son Rokhaniawan Perdata, S.T</name><uri>http://www.blogger.com/profile/17482607511048653600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_3PrCZQCxHao/SVJnUM5McbI/AAAAAAAAAHQ/4WvrWg1K28o/S220/son.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7464055709054203132.post-3822451759116087323</id><published>2009-03-12T00:30:00.002+07:00</published><updated>2009-03-12T00:36:30.564+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Project'/><title type='text'>GlassFish Project - Java Persistence Example</title><content type='html'>&lt;h3&gt;Overview&lt;/h3&gt; &lt;p&gt;This is a very simple example that uses only 2 entities - a Customer   and an Order, with OneToMany relationships between them. The Customer   and the Order classes are Plain Old Java Classes (POJOs). These   classes, as well as the code that manipulates POJO instances, can be   used without any changes in Java SE or Java EE environment.&lt;br /&gt;&lt;br /&gt;Accessing   an EntityManagerFactory and an EntityManager depends on the environment   and is described in more details below.&lt;br /&gt;&lt;br /&gt;We will create   a customer and two related orders, find the customer, and navigate from   the customer to its orders, and then merge and remove all the objects.   All these   operation will be performed using Java Persistence API and require &lt;a href="http://java.sun.com/j2se/1.5.0/download.jsp"&gt;JDK 5.0&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Click &lt;a href="http://glassfish.dev.java.net/javaee5/persistence/JPASE.zip"&gt;here&lt;/a&gt; to get   the ZIP file with the complete Java SE example as a netbeans project. This example works with Java DB or with Oracle. &lt;/p&gt; &lt;p&gt; Click &lt;a href="http://glassfish.dev.java.net/javaee5/persistence/ex1.zip"&gt;here&lt;/a&gt; to get the ZIP file with the complete Java SE example. This example works with Oracle.&lt;br /&gt;&lt;br /&gt;  Click &lt;a href="http://glassfish.dev.java.net/javaee5/persistence/ex1-ee.zip"&gt;here&lt;/a&gt; to get       the ZIP file with the complete Java EE example.&lt;br /&gt;&lt;br /&gt;  Refer to Java     Persistence API document of &lt;a href="http://jcp.org/en/jsr/detail?id=220"&gt;JSR-220:       Enterprise       JavaBeansTM       3.0 Specification&lt;/a&gt; for further details on annotations and APIs.&lt;br /&gt;&lt;br /&gt;  Check example sources for the     necessary import statements.&lt;/p&gt;&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;&lt;h3&gt;Mapping to Existing Tables&lt;/h3&gt; In the first example we will use only two tables:&lt;br /&gt;&lt;br /&gt;&lt;table style="width: 100px; text-align: left; background-color: rgb(255, 255, 204);" border="1" cellpadding="2" cellspacing="2"&gt;   &lt;tbody&gt;     &lt;tr&gt;       &lt;td style="vertical-align: top; text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;CUSTOMER&lt;/span&gt;&lt;br /&gt;    &lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;       &lt;td style="vertical-align: top;"&gt;ID&lt;br /&gt;    &lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;       &lt;td style="vertical-align: top;"&gt;NAME&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt; &lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table style="text-align: left; width: 211px; height: 117px; background-color: rgb(255, 255, 204);" border="1" cellpadding="2" cellspacing="2"&gt;   &lt;tbody&gt;     &lt;tr&gt;       &lt;td style="vertical-align: top; text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;ORDER_TABLE&lt;/span&gt;&lt;br /&gt;    &lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;       &lt;td style="vertical-align: top;"&gt;ORDER_ID&lt;br /&gt;    &lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;       &lt;td style="vertical-align: top;"&gt;SHIPPING_ADDRESS&lt;br /&gt;    &lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;       &lt;td style="vertical-align: top;"&gt;CUSTOMER_ID&lt;br /&gt;    &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt; &lt;/table&gt;&lt;br /&gt;&lt;br /&gt;CUSTOMER_ID column in the ORDER_TABLE is the Foreign Key (FK) to the ID column from the CUSTOMER table. The files &lt;span style="font-style: italic;"&gt;sql/tables_oracle.sql  &lt;span style="font-style: italic;"&gt; and sql/tables_derby.sql&lt;/span&gt;&lt;/span&gt; in the example contains DDL to create both tables for Oracle and Apache Derby.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;&lt;a name="POJOs" class="mozTocH3"&gt;&lt;/a&gt;POJO Classes&lt;/h3&gt; Now let's look at the corresponding persistence classes. Both entities in this example use property based persistence. There is no access annotation element on the entity, so it defaults to &lt;span style="font-size:78%;"&gt;&lt;span style="font-family:monospace;"&gt;access=PROPERTY&lt;/span&gt;&lt;/span&gt;. This is the reason why @Column annotation is specified for the get methods and not for the fields. The classes that are used as an argument or a return type between a  remote client and a container must implement &lt;span style="font-weight: bold;"&gt;java.io.Serializable&lt;/span&gt; interface.&lt;br /&gt;The POJO classes in the examples belong to an &lt;span style="font-style: italic;"&gt;entity&lt;/span&gt; package.&lt;br /&gt;&lt;h4&gt;&lt;a name="customer" class="mozTocH4"&gt;&lt;/a&gt;Customer&lt;/h4&gt; The Customer entity is mapped to the CUSTOMER table, and looks like this:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;@Entity&lt;br /&gt;public class Customer {&lt;br /&gt;&lt;br /&gt;  private int id;&lt;br /&gt;  private String name;&lt;br /&gt;  private Collection&lt;/code&gt;&lt;code&gt;&lt;order&gt;&lt;/order&gt;&lt;/code&gt;&lt;code&gt; orders;&lt;br /&gt;&lt;br /&gt;  @Id&lt;br /&gt;  public int getId() {&lt;br /&gt;      return id;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void setId(int id) {&lt;br /&gt;      this.id = id;&lt;br /&gt;  }&lt;br /&gt;&lt;/code&gt;&lt;code&gt;&lt;br /&gt;  public &lt;/code&gt;&lt;code&gt;String&lt;/code&gt;&lt;code&gt; getName() {&lt;br /&gt;      return name;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void setName(String &lt;/code&gt;&lt;code&gt;name&lt;/code&gt;&lt;code&gt;) {&lt;br /&gt;      this.&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;name&lt;/code&gt;&lt;code&gt; = &lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;name&lt;/code&gt;&lt;code&gt;;&lt;br /&gt;  }&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  @OneToMany(cascade=ALL, mappedBy="customer")&lt;br /&gt;  public Collection&lt;order&gt; getOrders() {&lt;br /&gt;      return orders;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void setOrders(Collection&lt;order&gt; newValue) {&lt;br /&gt;      this.orders = newValue;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/order&gt;&lt;/order&gt;&lt;/code&gt;&lt;br /&gt;Note that there are no @Table and @Column annotations. This is possible because the persistence provider will use the default rules to calculate those values for you. See chapter 9 of the &lt;a href="http://jcp.org/en/jsr/detail?id=220"&gt;Java Persistence API Specification&lt;/a&gt; for detailed rules of the mapping annotations. &lt;h4&gt;&lt;a name="order" class="mozTocH4"&gt;&lt;/a&gt;Order&lt;/h4&gt; The Order entity is mapped to the ORDER_TABLE table. It requires both @Table and @Column mapping annotations because table and column names do not match class and properties names exactly. @Column annotations are specified for the corresponding get methods:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;@Entity&lt;br /&gt;@Table(name="ORDER_TABLE")&lt;/code&gt;&lt;br /&gt;&lt;code&gt;public class Order {&lt;br /&gt;&lt;br /&gt;  private int id;&lt;br /&gt;  private String address;&lt;br /&gt;  private Customer customer;&lt;br /&gt;&lt;br /&gt;  @Id&lt;br /&gt;  &lt;/code&gt;&lt;code&gt;@Column(name="ORDER_ID")&lt;/code&gt;&lt;br /&gt;&lt;code&gt;    public int getId() {&lt;br /&gt;      return id;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void setId(int id) {&lt;br /&gt;      this.id = id;&lt;br /&gt;  }&lt;br /&gt;&lt;/code&gt;&lt;code&gt;&lt;br /&gt;  &lt;/code&gt;&lt;code&gt;@Column(name="SHIPPING_ADDRESS")&lt;/code&gt;&lt;br /&gt;&lt;code&gt;    public &lt;/code&gt;&lt;code&gt;String&lt;/code&gt;&lt;code&gt; get&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;Address&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;() {&lt;br /&gt;      return &lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;address&lt;/code&gt;&lt;code&gt;;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void set&lt;/code&gt;&lt;code&gt;Address&lt;/code&gt;&lt;code&gt;(String &lt;/code&gt;&lt;code&gt;address&lt;/code&gt;&lt;code&gt;) {&lt;br /&gt;      this.&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;address&lt;/code&gt;&lt;code&gt; = &lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;address&lt;/code&gt;&lt;code&gt;;&lt;br /&gt;  }&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  @ManyToOne()&lt;br /&gt;  @JoinColumn(name="CUSTOMER_ID")&lt;br /&gt;  public Customer getCustomer&lt;/code&gt;&lt;code&gt;() {&lt;br /&gt;      return &lt;/code&gt;&lt;code&gt;customer&lt;/code&gt;&lt;code&gt;;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void setCustomer&lt;/code&gt;&lt;code&gt;(&lt;/code&gt;&lt;code&gt;Customer&lt;/code&gt;&lt;code&gt; &lt;/code&gt;&lt;code&gt;customer&lt;/code&gt;&lt;code&gt;) {&lt;br /&gt;      this.&lt;/code&gt;&lt;code&gt;customer&lt;/code&gt;&lt;code&gt; = &lt;/code&gt;&lt;code&gt;customer&lt;/code&gt;&lt;code&gt;;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Note that Customer and Order have bidirectional relationships between the entities.&lt;br /&gt;&lt;h3&gt;&lt;a name="persist" class="mozTocH3"&gt;&lt;/a&gt;Persisting POJO Entities&lt;br /&gt;&lt;/h3&gt; Now, let's create new instances, set up the relationships and persist all of them together using the CASCADE option that we set on the Customer entity. This code must be executed in a context of an active transaction.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  // Create new customer&lt;br /&gt;  Customer customer0 = new Customer();&lt;br /&gt;  customer0.setId(1);&lt;br /&gt;  customer0.setName("Joe Smith");&lt;br /&gt;&lt;br /&gt;  // Persist the customer&lt;br /&gt;  em.persist(customer0);&lt;br /&gt;&lt;br /&gt;  // Create 2 orders&lt;br /&gt;  Order order1 = new Order();&lt;br /&gt;  order1.setId(100);&lt;br /&gt;  order1.setAddress("123 Main St. Anytown, USA");&lt;br /&gt;&lt;br /&gt;  Order order2 = new Order();&lt;br /&gt;  order2.setId(200);&lt;br /&gt;  order2.setAddress("567 1st St. Random City, USA");&lt;br /&gt;&lt;br /&gt;  // Associate orders with the customer.&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Note that the association must be set on both sides of the relationship: on the customer side for the orders to be persisted when transaction commits, and on the order side because it is the owning side:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;    customer0.getOrders().add(order1);&lt;br /&gt;  order1.setCustomer(customer0);&lt;br /&gt;&lt;br /&gt;  customer0.getOrders().add(order2);&lt;br /&gt;  order2.setCustomer(customer0);&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;When this transaction commits, all three entities will be persisted in the database.&lt;br /&gt;&lt;h3&gt;&lt;a name="query_and_navigation" class="mozTocH3"&gt;&lt;/a&gt;Query and Navigation&lt;br /&gt;&lt;/h3&gt; We'll use a new EntityManager to do the query, but will execute the query without an active transaction:&lt;br /&gt;&lt;br /&gt;  &lt;code&gt;// Create new EntityManager&lt;br /&gt;  em = emf.createEntityManager();&lt;br /&gt;&lt;br /&gt;  Query q = em.createQuery("select c from Customer c where c.name = :name");&lt;br /&gt;  q.setParameter("name", "Joe Smith");&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;Our query is supposed to return a single customer, so we will use the Query method &lt;span style="font-style: italic;"&gt;getSingleResult()&lt;/span&gt; to execute the query. This method would throw an exception if there is no or more than one matching customers.&lt;code&gt;&lt;br /&gt;&lt;br /&gt;  Customer c = (Customer)q.getSingleResult();&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Now let's verify that the orders were also created by navigating from the Customer.&lt;br /&gt;You can print the orders, but we'll just check the size:&lt;br /&gt;&lt;br /&gt;    &lt;code&gt;Collection&lt;order&gt; orders = c.getOrders();&lt;br /&gt;  if (orders == null || orders.size() != 2) {&lt;br /&gt;      throw new RuntimeException("Unexpected number of orders: "&lt;br /&gt;              + ((orders == null)? "null" : "" + orders.size()));&lt;br /&gt;  }&lt;/order&gt;&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;h3&gt;&lt;a name="merge_and_remove" class="mozTocH3"&gt;&lt;/a&gt;Merge and Removal of Persistent Instances&lt;br /&gt;&lt;/h3&gt; To remove an instance, it must be managed by this EntityManager. The code below uses a customer '&lt;span style="font-style: italic;"&gt;c&lt;/span&gt;' that had been detached from its persistence context. Removal of the Customer also removes related orders because of the CASCADE option set on the corresponding relationship. This code must be executed in a context of an active transaction.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;    // Merge the customer to the new persistence context&lt;br /&gt;  Customer c0 = em.merge(c);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Note that &lt;span style="font-style: italic;"&gt;merge()&lt;/span&gt; is not a void operation. It returns back a managed copy of the argument (and its related objects). Only this copy can be used for EntityManager operations.&lt;code&gt;&lt;br /&gt;&lt;br /&gt;  // Delete all records&lt;br /&gt;  em.remove(c0);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;h3&gt;&lt;a name="all_together"&gt;&lt;/a&gt;Putting It All Together&lt;br /&gt;&lt;/h3&gt; &lt;h4&gt;&lt;a name="Using_in_Java_SE" class="mozTocH3"&gt;&lt;/a&gt;Using in Java SE&lt;/h4&gt; First, we need to create an EntityManagerFactory that we will use in the example. An EntityManagerFactory is created once for each PersistentUnit. Persistent unit in this example is called "pu1".&lt;br /&gt;&lt;br /&gt;&lt;code&gt;   // Create EntityManagerFactory for persistent unit named "pu1"&lt;br /&gt; // to be used in this test&lt;br /&gt; emf = Persistence.createEntityManagerFactory("pu1");&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;For each business method in the example, a new EntityManager is created:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;    // Create new EntityManager&lt;br /&gt;  em = emf.createEntityManager();&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;If a transaction required, it is started:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;    // Begin transaction&lt;br /&gt;  em.getTransaction().begin();&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;And then the business logic is executed in a separate business method:&lt;br /&gt;&lt;br /&gt;      &lt;code&gt;// Business logic&lt;/code&gt;&lt;br /&gt;      &lt;code&gt;mybusinessmethod(...);&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;If transaction has been started it must be committed:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;code&gt;    // Commit the transaction&lt;br /&gt;  em.getTransaction().commit();&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;And EntityManager should always be closed if it won't be used again:&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;    // Close this EntityManager&lt;br /&gt;  em.close();&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;Java SE client code in this &lt;a href="http://glassfish.dev.java.net/javaee5/persistence/ex1.zip"&gt;example&lt;/a&gt; is located in the class &lt;span style="font-style: italic;"&gt;client.Client&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;To run the test, you need to create &lt;span style="font-weight: bold;"&gt;META-INF/persistence.xml&lt;/span&gt; file in the classpath. Copy META-INF/persistence.xml.template file from the classes directory in the example to META-INF/persistence.xml and populate the values of the corresponding properties with the database settings that you are using. Note that persistence-unit name is set to "pu1" and all entity classes are explicitly listed.&lt;br /&gt;&lt;br /&gt;Add your database driver and classes directory from the unzipped example to the classpath, load the tables into the database, then run:&lt;br /&gt;&lt;br /&gt;&lt;div style="margin-left: 40px;"&gt;   &lt;p&gt;&lt;code&gt; java   -javaagent:${glassfish.home}/lib/toplink-essentials-agent.jar   client.Client&lt;br /&gt;&lt;/code&gt;&lt;/p&gt;   &lt;p&gt; &lt;/p&gt; &lt;/div&gt; &lt;h4&gt;&lt;a name="Using_Netbeans_Java_SE_Example" id="Using_Netbeans_Java_SE_Example"&gt;&lt;/a&gt;Using the Java SE Example in Netbeans&lt;/h4&gt; &lt;ul&gt;&lt;li&gt;Download &lt;a href="http://www.netbeans.info/downloads/index.php"&gt;Netbeans 5.5&lt;/a&gt; and install the bundle&lt;/li&gt;&lt;li&gt;Download and install &lt;a href="http://developers.sun.com/prodtech/javadb/downloads/index.jsp"&gt;Java DB/Derby&lt;/a&gt; if you plan on using Java DB/Derby instead of Oracle.      &lt;ul&gt;&lt;li&gt;Configure Netbeans to use Java DB/Derby by following the steps in this &lt;a href="http://www.netbeans.org/kb/50/derby-demo.html"&gt;tutorial&lt;/a&gt; . &lt;/li&gt;&lt;/ul&gt;   &lt;/li&gt;&lt;li&gt;Install the &lt;a href="http://glassfish.dev.java.net/javaee5/persistence/JPASE.zip"&gt;JAVA SE Persistence Example project &lt;/a&gt; .&lt;/li&gt;&lt;/ul&gt; &lt;h5&gt;Configuring the JDBC driver&lt;/h5&gt; &lt;p&gt;To configure the JDBC driver to be used when running the project, right-click on the project, select properties. Click on the libraries and then click on the 'Add JAR/Folder' button to add the jars for the JDBC driver being used. In the example below, the Java DB/Derby JDBC Client Driver is added. &lt;/p&gt; &lt;p&gt;&lt;img style="width: 550px; height: 362px;" src="https://glassfish.dev.java.net/javaee5/persistence/ProjectProperties.PNG" /&gt;&lt;/p&gt; &lt;h5&gt;Creating the tables&lt;/h5&gt; &lt;p&gt;Scripts are provided to create the tables needed for the example for either Java DB/Derby or Oracle. &lt;/p&gt; &lt;blockquote&gt;   &lt;p&gt; &lt;strong&gt;Note&lt;/strong&gt;:If you are using Oracle, go to the runtime tab, click databases and then right click drivers to add the Oracle driver so that it can be used with the SQL Editor. &lt;/p&gt;   &lt;/blockquote&gt; &lt;ul&gt;&lt;li&gt;Create a connection to the database     &lt;ul&gt;&lt;li&gt;expand the drivers folder and right click on the Oracle or Java DB/Derby driver and create a connection to the database. For Java DB/Derby you can enter: &lt;span class="style1"&gt;jdbc:derby://localhost:1527/&lt;/span&gt;testDB;create=true and enter APP for the username and password. &lt;/li&gt;&lt;/ul&gt;   &lt;/li&gt;&lt;li&gt;If you are using Java DB/Derby and the server is not started, Select Tools-&gt;Java DB Database -&gt;Start Java DB server &lt;/li&gt;&lt;li&gt;Open the appropriate sql script by typing Ctrl-O or selecting 'Open File' from the file menu. The SQL scripts are in the sql directory of the project.&lt;/li&gt;&lt;li&gt;Select the connection to use (for Java DB/Derby you can use &lt;span class="style1"&gt;jdbc:derby://localhost:1527/testDB;create=true [APP on APP]&lt;/span&gt; .&lt;/li&gt;&lt;li&gt;Click the Run SQL icon &lt;img src="https://glassfish.dev.java.net/javaee5/persistence/RunSQL.png" align="absmiddle" width="26" height="22" /&gt; on the right of the Connection drop-down box. This will open the Connect dialog. Enter the password for your connection. &lt;strong&gt;&lt;/strong&gt;. Click OK to connect and run the SQL script. &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;img style="width: 508px; height: 489px;" src="https://glassfish.dev.java.net/javaee5/persistence/SQLEditor.PNG" /&gt;&lt;/p&gt; &lt;h5&gt;Configuring the persistence unit &lt;/h5&gt; &lt;p&gt;To configure the persistence unit for the sample, click on source packages and then click on META-INF. Double click on persistence.xml. Your configuration should look like the following if you are using Java DB/Derby:&lt;/p&gt; &lt;p&gt;&lt;img style="width: 528px; height: 544px;" src="https://glassfish.dev.java.net/javaee5/persistence/pu.PNG" /&gt; &lt;/p&gt; &lt;h5&gt;Running the project:&lt;/h5&gt; &lt;p&gt;To run the the sample application. Right click on the project and select 'Run Project'. &lt;/p&gt; &lt;p&gt;  &lt;/p&gt; &lt;h4&gt;&lt;a name="Using_in_Java_EE"&gt;&lt;/a&gt;Using in Java EE&lt;/h4&gt; In a Java EE container, the client code will not create an EntityManagerFactory - it is done by the container.&lt;br /&gt;&lt;br /&gt;There are several option to get a hold of an EntityManager:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;An EntityManagerFactory or an EntityManager can be injected by the container or looked up in JNDI.&lt;/li&gt;&lt;li&gt;An EntityManager instance can be acquired from an EntityManagerFactory via the corresponding API call.&lt;/li&gt;&lt;/ul&gt; Transaction boundaries depend on the EntityManager type:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;A JTA EntityManager participates in the current JTA transaction that is either controlled by the container or by a user via &lt;span style="font-style: italic;"&gt;javax.transaction.UserTransaction&lt;/span&gt; API.&lt;/li&gt;&lt;li&gt;A resource-local EntityManager uses the same Java Persistence API as in &lt;a href="http://glassfish.dev.java.net/javaee5/persistence/persistence-example.html#Using_in_Java_SE"&gt;Java SE&lt;/a&gt; environment to control its transactions.&lt;/li&gt;&lt;/ul&gt; In our &lt;a href="https://glassfish.dev.java.net/javaee5/persistence/ex1-ee.zip"&gt;example&lt;/a&gt; a JTA EntityManager is injected by the container into the Session Bean:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;    @PersistenceContext(unitName="pu1")&lt;br /&gt;  private EntityManager em;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Transaction boundaries set to container-managed defaults.&lt;br /&gt;&lt;br /&gt;The client code from the Java SE example is now divided between a Stateless Session Bean &lt;span style="font-style: italic;"&gt;ejb.TestBean&lt;/span&gt; (implements &lt;span style="font-style: italic;"&gt;ejb.Test&lt;/span&gt; remote business interface), which contains the business logic (i.e. exactly the same business methods as the Java SE client), and an application client &lt;span style="font-style: italic;"&gt;client.AppClient&lt;/span&gt; that calls the corresponding methods and prints the output:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;    // Persist all entities&lt;br /&gt;  System.out.println("Inserting Customer and Orders... " + sb.testInsert());&lt;br /&gt;&lt;br /&gt;  // Test query and navigation&lt;br /&gt;  System.out.println("Verifying that all are inserted... " + sb.verifyInsert());&lt;br /&gt;&lt;br /&gt;  // Get a detached instance&lt;br /&gt;  Customer c = sb.findCustomer("Joe Smith");&lt;br /&gt;&lt;br /&gt;  // Remove all entities&lt;br /&gt;  System.out.println("Removing all... " + sb.testDelete(c));&lt;br /&gt;&lt;br /&gt;  // Query the results&lt;br /&gt;  System.out.println("Verifying that all are removed... " + sb.verifyDelete());&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In the Java EE environment META-INF/persistence.xml does not need to list persistence classes, or the &lt;provider&gt; (if you use the default persistence provider). It should specify &lt;jta-data-source&gt;, if it does not use the default DataSource provided by the container. The example specifies jdbc/__default, which is the default for the Derby database, so that it is easy to replace with another name. Java EE example uses &lt;a href="http://blogs.sun.com/roller/page/java2dbInGlassFish"&gt;automatic table generation&lt;/a&gt; feature in GlassFish by setting required properties in the META-INF/persistence.xml.&lt;br /&gt;&lt;br /&gt;To test the example, unzip it and deploy ex1-ee.ear file:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  ${glassfish.home}/bin/asadmin deploy --retrieve . ex1-ee.ear&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;Then execute the &lt;span style="font-style: italic;"&gt;appclient&lt;/span&gt; script:&lt;code&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;code&gt;    ${glassfish.home}&lt;/code&gt;&lt;code&gt;/bin/appclient -client ./ex1-eeClient.jar -mainclass client.AppClient&lt;br /&gt;&lt;/code&gt; &lt;/jta-data-source&gt;&lt;/provider&gt;&lt;/span&gt;&lt;h4&gt;&lt;span id="fullpost"&gt;&lt;a name="result"&gt;&lt;/a&gt;The Result&lt;br /&gt;&lt;/span&gt;&lt;/h4&gt;&lt;span id="fullpost"&gt; This is the output (after several extra log messages) that will be printed:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;Inserting Customer and Orders... OK&lt;br /&gt;Verifying that all are inserted... OK&lt;br /&gt;Removing all... OK&lt;br /&gt;Verifying that all are removed... OK&lt;/code&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7464055709054203132-3822451759116087323?l=project-java.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://project-java.blogspot.com/feeds/3822451759116087323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://project-java.blogspot.com/2009/03/glassfish-project-java-persistence.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/3822451759116087323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/3822451759116087323'/><link rel='alternate' type='text/html' href='http://project-java.blogspot.com/2009/03/glassfish-project-java-persistence.html' title='GlassFish Project - Java Persistence Example'/><author><name>Son Rokhaniawan Perdata, S.T</name><uri>http://www.blogger.com/profile/17482607511048653600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_3PrCZQCxHao/SVJnUM5McbI/AAAAAAAAAHQ/4WvrWg1K28o/S220/son.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7464055709054203132.post-7346106886468536622</id><published>2009-03-12T00:26:00.002+07:00</published><updated>2009-03-12T00:37:36.465+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='News'/><title type='text'>Latest Jakarta News</title><content type='html'>&lt;div class="section-body"&gt;              &lt;ul&gt;&lt;li&gt; &lt;a href="http://jakarta.apache.org/site/news/news-2009-q1.html#20090126.1"&gt;26 January 2009 - &lt;b&gt;Apache Cactus 1.8.1&lt;/b&gt; Released &lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href="http://jakarta.apache.org/site/news/news-2008-q2.html#20080614.1"&gt;14 June 2008 - &lt;b&gt;Apache JMeter 2.3.2&lt;/b&gt; Released &lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href="http://jakarta.apache.org/site/news/news-2008-q1.html#20080411.1"&gt;11 April 2008 - &lt;b&gt;Apache Cactus 1.8.0&lt;/b&gt; Released &lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href="http://jakarta.apache.org/site/news/news-2007-q4.html#20071130.1"&gt;30 November 2007 - &lt;b&gt;Apache JMeter 2.3.1 final&lt;/b&gt; Released &lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href="http://jakarta.apache.org/site/news/news-2007-q4.html#20071115.1"&gt;15 November 2007 - &lt;b&gt;HttpComponents TLP move&lt;/b&gt; &lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href="http://jakarta.apache.org/site/news/news-2007-q4.html#20071107.1"&gt;07 November 2007 - &lt;b&gt;HttpComponents HttpClient 4.0-alpha2&lt;/b&gt; Released &lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href="http://jakarta.apache.org/site/news/news-2007-q4.html#20071103.1"&gt;03 November 2007 - &lt;b&gt;Slide is retired&lt;/b&gt; &lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href="http://jakarta.apache.org/site/news/news-2007-q4.html#20071009.1"&gt;09 October 2007 - &lt;b&gt;HttpComponents HttpCore 4.0-alpha6&lt;/b&gt; Released &lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href="http://jakarta.apache.org/site/news/news-2007-q3.html#20070929.1"&gt;29 September 2007 - &lt;b&gt;Apache JMeter 2.3 final&lt;/b&gt; Released &lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href="http://jakarta.apache.org/site/news/news-2007-q3.html#20070905.1"&gt;05 September 2007 - &lt;b&gt;Apache JMeter 2.3RC4&lt;/b&gt; Released &lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href="http://jakarta.apache.org/site/news/news-2007-q3.html#20070822.1"&gt;22 August 2007 - &lt;b&gt;Jakarta Commons HttpClient 3.1&lt;/b&gt; Released &lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href="http://jakarta.apache.org/site/news/news-2007-q3.html#20070720.1"&gt;20 July 2007 - &lt;b&gt;HttpComponents HttpClient 4.0-alpha1&lt;/b&gt; Released &lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href="http://jakarta.apache.org/site/news/news-2007-q3.html#20070711.1"&gt;11 July 2007 - &lt;b&gt;Apache JMeter 2.3RC3&lt;/b&gt; Released &lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href="http://jakarta.apache.org/site/news/news-2007-q3.html#20070708.1"&gt;08 July 2007 - &lt;b&gt;Commons CLI 1.1&lt;/b&gt; Released &lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href="http://jakarta.apache.org/site/news/news-2007-q3.html#20070704.1"&gt;04 July 2007 - &lt;b&gt;HttpComponents HttpCore 4.0-alpha5&lt;/b&gt; Released &lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href="http://jakarta.apache.org/site/news/news-2007-q3.html#20070702.1"&gt;02 July 2007 - &lt;b&gt;Commons IO 1.3.2&lt;/b&gt; Released &lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href="http://jakarta.apache.org/site/news/news-2007-q2.html#20070618.1"&gt;18 June 2007 - &lt;b&gt;Jakarta Commons JCI 1.0&lt;/b&gt; Released &lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href="http://jakarta.apache.org/site/news/news-2007-q2.html#20070608.1"&gt;08 June 2007 - &lt;b&gt;POI TLP move&lt;/b&gt; &lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href="http://jakarta.apache.org/site/news/news-2007-q2.html#20070607.1"&gt;07 June 2007 - &lt;b&gt;Turbine TLP move&lt;/b&gt; &lt;/a&gt; &lt;/li&gt;&lt;li&gt; &lt;a href="http://jakarta.apache.org/site/news/news-2007-q2.html#20070606.1"&gt;06 June 2007 - &lt;b&gt;Jakarta JCS 1.3&lt;/b&gt; Released &lt;/a&gt; &lt;/li&gt;&lt;/ul&gt;     &lt;/div&gt;&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7464055709054203132-7346106886468536622?l=project-java.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://project-java.blogspot.com/feeds/7346106886468536622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://project-java.blogspot.com/2009/03/latest-jakarta-news.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/7346106886468536622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/7346106886468536622'/><link rel='alternate' type='text/html' href='http://project-java.blogspot.com/2009/03/latest-jakarta-news.html' title='Latest Jakarta News'/><author><name>Son Rokhaniawan Perdata, S.T</name><uri>http://www.blogger.com/profile/17482607511048653600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_3PrCZQCxHao/SVJnUM5McbI/AAAAAAAAAHQ/4WvrWg1K28o/S220/son.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7464055709054203132.post-1444472610134379916</id><published>2009-03-05T00:29:00.002+07:00</published><updated>2009-03-05T00:32:24.413+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Project'/><title type='text'>BluePrints Program</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blueprints.dev.java.net/images/bpmainlogo.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 455px; height: 192px;" src="https://blueprints.dev.java.net/images/bpmainlogo.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;&lt;p style="text-align: center;"&gt; &lt;a href="https://blueprints.dev.java.net/downloads.html"&gt; &lt;img alt="Download Now" src="https://blueprints.dev.java.net/images/download-now.gif" width="156" height="75" /&gt;&lt;/a&gt;  &lt;a href="https://blueprints.dev.java.net/find-a-blueprint.html"&gt; &lt;img alt="Find a BluePrint" src="https://blueprints.dev.java.net/images/find-a-blueprint.gif" width="156" height="75" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="https://blueprints.dev.java.net/feedback.html"&gt; &lt;img alt="Discuss BluePrints" src="https://blueprints.dev.java.net/images/discuss-blueprints.gif" width="156" height="75" /&gt;&lt;/a&gt;  &lt;a href="https://blueprints.dev.java.net/about.html"&gt; &lt;img alt="About BluePrints" src="https://blueprints.dev.java.net/images/about-blueprints.gif" width="156" height="75" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7464055709054203132-1444472610134379916?l=project-java.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://project-java.blogspot.com/feeds/1444472610134379916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://project-java.blogspot.com/2009/03/blueprints-program.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/1444472610134379916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/1444472610134379916'/><link rel='alternate' type='text/html' href='http://project-java.blogspot.com/2009/03/blueprints-program.html' title='BluePrints Program'/><author><name>Son Rokhaniawan Perdata, S.T</name><uri>http://www.blogger.com/profile/17482607511048653600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_3PrCZQCxHao/SVJnUM5McbI/AAAAAAAAAHQ/4WvrWg1K28o/S220/son.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7464055709054203132.post-2645418495915048234</id><published>2009-02-28T15:53:00.002+07:00</published><updated>2009-02-28T16:04:12.425+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Certification'/><title type='text'>Mock exam 1</title><content type='html'>&lt;p&gt; The sample test is modeled on the Sun Certification for JavaTM           2 Programmer exam. The test has 59 questions and needs to be executed           in 2 hours. The real exam may be a little tougher than this. You need           to score 36 correct answers to clear the real exam. The first 50 questions           of the mock exam are valid for both 1.2 and 1.4 versions of the exam.           The remaining 9 questions are only useful if you are taking the SCJP 1.2           exam. Please &lt;a href="mailto:mail@studyjava.org"&gt;let me know&lt;/a&gt; if you           find any issues with the test. The site also offers &lt;a href="http://www.studyjava.org/exam/quests/test2.html"&gt;another           mock exam&lt;/a&gt;.&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;&lt;ol type="1"&gt;&lt;br /&gt;&lt;li&gt;Which declaration of the main method below would allow a class to  be started as a standalone program. Select the one correct answer. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt;public static int main(char args[])&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;public static void main(String args[])&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;public static void MAIN(String args[])&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;public static void main(String args)&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;public static void main(char args[])&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; What all gets printed when the following code is compiled and run? Select the three correct answers.&lt;/li&gt;&lt;br /&gt;&lt;pre&gt;  public class xyz {    &lt;br /&gt;public static void main(String args[]) {&lt;br /&gt;       for(int i = 0; i &amp;lt; 2; i++) {&lt;br /&gt;          for(int j = 2; j&amp;gt;= 0; j--) {&lt;br /&gt;             if(i == j) break;             &lt;br /&gt;System.out.println("i=" + i + " j="+j);          &lt;br /&gt;}       &lt;br /&gt;}    &lt;br /&gt;} &lt;br /&gt;}    &lt;/pre&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt;i=0 j=0&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;i=0 j=1&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;i=0 j=2&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;i=1 j=0&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;i=1 j=1&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;i=1 j=2&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;i=2 j=0&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;i=2 j=1&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;i=2 j=2&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; What gets printed when the following code is compiled and run with the following command -&lt;br /&gt;&lt;br /&gt;  java test 2&lt;br /&gt;&lt;br /&gt;  Select the one correct answer.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;pre&gt;  public class test {    &lt;br /&gt;public static void main(String args[]) {        &lt;br /&gt;Integer intObj=Integer.valueOf(args[args.length-1]);       &lt;br /&gt;int i = intObj.intValue();         &lt;br /&gt;if(args.length &amp;gt; 1)           &lt;br /&gt;System.out.println(i);       &lt;br /&gt;if(args.length &amp;gt; 0)          &lt;br /&gt;System.out.println(i - 1);       &lt;br /&gt;else           &lt;br /&gt;System.out.println(i - 2);    &lt;br /&gt;} &lt;br /&gt;}              &lt;/pre&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt;test&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;test -1&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;0&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;1&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;2&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; In Java technology what expression can be used to represent number of elements in an array named arr ?&lt;/li&gt;&lt;br /&gt;&lt;li&gt; How would the number 5 be represented in hex using up-to four characters. &lt;/li&gt;&lt;br /&gt;&lt;!-- Question 6 --&gt;&lt;br /&gt;&lt;li&gt; Which of the following is a Java keyword. Select the four correct answers. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt;extern&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;synchronized&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;volatile&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;friend&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;friendly&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;transient&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;this&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;then&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; Is the following statement true or false. The constructor of a class must not have a return type. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt;true&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;false&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; What is the number of bytes used by Java primitive long. Select the one correct answer. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt;The number of bytes is compiler dependent.&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;2&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;4&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;8&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;64&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; What is returned when the method substring(2, 4) is invoked on the  string "example"? Include the answer in quotes as the result is of type  String.&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Which of the following is correct? Select the two correct answers.&lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; The native keyword indicates that the method is implemented in another language like C/C++. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; The only statements that can appear before an import statement in a Java file are comments. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; The method definitions inside interfaces are public and abstract. They cannot be private or protected. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; A class constructor may have public or protected keyword before them, nothing else. &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;!-- Question 11 --&gt;&lt;br /&gt;&lt;li&gt; What is the result of evaluating the expression  14 ^ 23. Select the one correct answer. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; 25 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 37 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 6 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 31 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 17 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 9 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 24 &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; Which of the following are true. Select the one correct answers. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; &amp;amp;&amp;amp; operator is used for short-circuited logical AND. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; ~ operator is the bit-wise XOR operator. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; | operator is used to perform bitwise OR and also short-circuited logical OR. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; The unsigned right shift operator in Java is &amp;gt;&amp;gt;. &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; Name the access modifier which when used with a method, makes it  available to all the classes in the same package and to all the  subclasses of the class. &lt;/li&gt;&lt;br /&gt;&lt;li&gt; Which of the following is true. Select the two correct answers. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; A class that is abstract may not be instantiated. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; The final keyword indicates that the body of a method is to be  found elsewhere. The code is written in non-Java language, typically in  C/C++. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; A static variable indicates there is only one copy of that variable. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; A method defined as private indicates that it is accessible to all other classes in the same package.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; What all gets printed when the following program is compiled and run. Select the two correct answers. &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;  public class test {    &lt;br /&gt;public static void main(String args[]) {        &lt;br /&gt;int i, j=1;       &lt;br /&gt;i = (j&amp;gt;1)?2:1;       &lt;br /&gt;&lt;br /&gt;switch(i) {         &lt;br /&gt;case 0:&lt;br /&gt;System.out.println(0);&lt;br /&gt;break;         &lt;br /&gt;case 1:&lt;br /&gt;System.out.println(1);         &lt;br /&gt;case 2:&lt;br /&gt;System.out.println(2);&lt;br /&gt;break;         &lt;br /&gt;case 3:&lt;br /&gt;System.out.println(3);&lt;br /&gt;break;       &lt;br /&gt;}    &lt;br /&gt;} &lt;br /&gt;}              &lt;/pre&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; 0 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 1 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 2 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 3 &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;!-- Question 16 --&gt;&lt;br /&gt;&lt;li&gt; What all gets printed when the following program is compiled and run. Select the one correct answer. &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;  public class test {    &lt;br /&gt;public static void main(String args[]) {        &lt;br /&gt;int i=0, j=2;       &lt;br /&gt;do&lt;br /&gt;{          &lt;br /&gt;i=++i;          &lt;br /&gt;j--;       &lt;br /&gt;}&lt;br /&gt;while(j&amp;gt;0);       &lt;br /&gt;System.out.println(i);    &lt;br /&gt;} &lt;br /&gt;}              &lt;/pre&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; 0 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 1 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 2 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; The program does not compile because of statement "i=++i;" &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; What all gets printed when the following gets compiled and run. Select the three correct answers.&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;  public class test {     &lt;br /&gt;public static void main(String args[]) {          &lt;br /&gt;int i=1, j=1;         &lt;br /&gt;try {             &lt;br /&gt;i++;              &lt;br /&gt;j--;             &lt;br /&gt;if(i/j &amp;gt; 1)                 &lt;br /&gt;i++;         &lt;br /&gt;}         &lt;br /&gt;catch(ArithmeticException e) {             &lt;br /&gt;System.out.println(0);         &lt;br /&gt;}         &lt;br /&gt;catch(ArrayIndexOutOfBoundsException e) {             &lt;br /&gt;System.out.println(1);         &lt;br /&gt;}         &lt;br /&gt;catch(Exception e) {             &lt;br /&gt;System.out.println(2);         &lt;br /&gt;}         &lt;br /&gt;finally&lt;br /&gt;{             &lt;br /&gt;System.out.println(3);         &lt;br /&gt;}         &lt;br /&gt;System.out.println(4);      &lt;br /&gt;} &lt;br /&gt;}              &lt;/pre&gt;&lt;br /&gt;  &lt;ol type="A"&gt;&lt;br /&gt;    &lt;li&gt; 0 &lt;/li&gt;&lt;br /&gt;    &lt;li&gt; 1 &lt;/li&gt;&lt;br /&gt;    &lt;li&gt; 2 &lt;/li&gt;&lt;br /&gt;    &lt;li&gt; 3 &lt;/li&gt;&lt;br /&gt;    &lt;li&gt; 4 &lt;/li&gt;&lt;br /&gt;  &lt;/ol&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt; What all gets printed when the following gets compiled and run. Select the two correct answers. &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;  public class test {     &lt;br /&gt;public static void main(String args[]) {          &lt;br /&gt;int i=1, j=1;         &lt;br /&gt;try {             &lt;br /&gt;i++;              &lt;br /&gt;j--;             &lt;br /&gt;if(i == j)                 &lt;br /&gt;i++;         &lt;br /&gt;}         &lt;br /&gt;catch(ArithmeticException e) {             &lt;br /&gt;System.out.println(0);         &lt;br /&gt;}         &lt;br /&gt;catch(ArrayIndexOutOfBoundsException e) {             &lt;br /&gt;System.out.println(1);         &lt;br /&gt;}         &lt;br /&gt;catch(Exception e) {             &lt;br /&gt;System.out.println(2);         &lt;br /&gt;}         &lt;br /&gt;finally {             &lt;br /&gt;System.out.println(3);         &lt;br /&gt;}         &lt;br /&gt;System.out.println(4);      &lt;br /&gt;} &lt;br /&gt;}              &lt;/pre&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; 0 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 1 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 2 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 3 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 4 &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; What all gets printed when the following gets compiled and run. Select the two correct answers. &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;  public class test {     &lt;br /&gt;public static void main(String args[]) {      &lt;br /&gt;String s1 = "abc";     &lt;br /&gt;String s2 = "abc";     &lt;br /&gt;if(s1 == s2)         &lt;br /&gt;System.out.println(1);     &lt;br /&gt;else         &lt;br /&gt;System.out.println(2);     &lt;br /&gt;if(s1.equals(s2))         &lt;br /&gt;System.out.println(3);     &lt;br /&gt;else         &lt;br /&gt;System.out.println(4);     &lt;br /&gt;} &lt;br /&gt;}              &lt;/pre&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; 1 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 2 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 3 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 4 &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; What all gets printed when the following gets compiled and run. Select the two correct answers. &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;  public class test {     &lt;br /&gt;public static void main(String args[]) {      &lt;br /&gt;String s1 = "abc";     &lt;br /&gt;String s2 = new String("abc");       &lt;br /&gt;if(s1 == s2)         &lt;br /&gt;System.out.println(1);     &lt;br /&gt;else         &lt;br /&gt;System.out.println(2);     &lt;br /&gt;if(s1.equals(s2))         &lt;br /&gt;System.out.println(3);     &lt;br /&gt;else         &lt;br /&gt;System.out.println(4);     &lt;br /&gt;} &lt;br /&gt;}              &lt;/pre&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; 1 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 2 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 3 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 4 &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;!-- Question 21 --&gt;&lt;br /&gt;&lt;li&gt; Which of the following are legal array declarations. Select the three correct answers. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; int i[5][];&lt;/li&gt;&lt;br /&gt;  &lt;li&gt; int i[][]; &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; int []i[];&lt;/li&gt;&lt;br /&gt;  &lt;li&gt; int i[5][5]; &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; int[][] a; &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; What is the range of values that can be specified for an int. Select the one correct answer. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; The range of values is compiler dependent. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; -231 to 231 - 1&lt;/li&gt;&lt;br /&gt;  &lt;li&gt; -231-1 to 231&lt;/li&gt;&lt;br /&gt;  &lt;li&gt; -215 to 215 - 1&lt;/li&gt;&lt;br /&gt;  &lt;li&gt; -215-1 to 215&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; How can you ensure that the memory allocated by an object is freed. Select the one correct answer.&lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; By invoking the free method on the object. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; By calling system.gc() method. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; By setting all references to the object to new values (say null).&lt;/li&gt;&lt;br /&gt;  &lt;li&gt; Garbage collection cannot be forced. The programmer cannot force the JVM to free the memory used by an object.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;!-- Question 26 --&gt;&lt;br /&gt;&lt;li&gt; What gets printed when the following code is compiled and run. Select the one correct answer.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;  public class test {     &lt;br /&gt;public static void main(String args[]) {      &lt;br /&gt;int i = 1;     &lt;br /&gt;do {         &lt;br /&gt;i--;     &lt;br /&gt;}&lt;br /&gt;while (i &amp;gt; 2);     &lt;br /&gt;System.out.println(i);     &lt;br /&gt;} &lt;br /&gt;}              &lt;/pre&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; 0 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 1 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 2 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; -1 &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt;Which of these is a legal definition of a method named m assuming  it throws IOException, and returns void. Also assume that the method  does not take any arguments. Select the one correct answer. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt;void m() throws IOException{}&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;void m() throw IOException{}&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;void m(void) throws IOException{}&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;m() throws IOException{}&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;void m() {} throws IOException&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt;Which of the following are legal identifier names in Java. Select the two correct answers. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; %abcd &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; $abcd &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 1abcd &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; package &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; _a_long_name &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt;At what stage in the following method does the object initially  referenced by s becomes available for garbage collection. Select the  one correct answer. &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;  void method X()  {      &lt;br /&gt;String r = new String("abc");     &lt;br /&gt;String s = new String("abc");     &lt;br /&gt;r = r+1; //1     &lt;br /&gt;r = null; //2     &lt;br /&gt;s = s + r; //3 &lt;br /&gt;} //4              &lt;/pre&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; Before statement labeled 1 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; Before statement labeled 2 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; Before statement labeled 3 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; Before statement labeled 4 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; Never. &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; String s = new String("xyz");&lt;br /&gt;&lt;br /&gt;  Assuming the above declaration, which of the following statements would compile. Select the one correct answer.&lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; s = 2 * s; &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; int i = s[0]; &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; s = s + s; &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; s = s &amp;gt;&amp;gt; 2; &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; None of the above. &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;!-- Question 31 --&gt;&lt;br /&gt;&lt;li&gt;Which of the following statements related to Garbage Collection are correct. Select the two correct answers. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; It is possible for a program to free memory at a given time. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; Garbage Collection feature of Java ensures that the program never runs out of memory. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; It is possible for a program to make an object available for Garbage Collection. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; The finalize method of an object is invoked before garbage collection is performed on the object. &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt;If a base class has a method defined as&lt;br /&gt;&lt;br /&gt;  void method() { }&lt;br /&gt;&lt;br /&gt;  Which of the following are legal prototypes in a derived class of this class. Select the two correct answers. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; void method() { } &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; int method() { return 0;}&lt;/li&gt;&lt;br /&gt;  &lt;li&gt; void method(int i) { } &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; private void method() { } &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; In which all cases does an exception gets generated. Select the two correct answers. &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int i = 0, j = 1;&lt;br /&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; if((i == 0) || (j/i == 1)) &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; if((i == 0) | (j/i == 1)) &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; if((i != 0) &amp;amp;&amp;amp; (j/i == 1)) &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; if((i != 0) &amp;amp; (j/i == 1)) &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;!-- Question 36 --&gt;&lt;br /&gt;&lt;li&gt; Which of the following statements are true. Select the two correct answers. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; The wait method defined in the Thread class, can be used to convert a thread from Running state to Waiting state. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; The wait(), notify(), and notifyAll() methods must be executed in synchronized code.&lt;/li&gt;&lt;br /&gt;  &lt;li&gt; The notify() and notifyAll() methods can be used to signal and move waiting threads to ready-to-run state. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; The Thread class is an abstract class. &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; Which keyword when applied on a method indicates that only one  thread should execute the method at a time. Select the one correct  answer. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; transient &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; volatile&lt;/li&gt;&lt;br /&gt;  &lt;li&gt; synchronized &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; native &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; static &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; final &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; What is the name of the Collection interface used to represent  elements in a sequence (in a particular order). Select the one correct  answer. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; Collection &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; Set&lt;/li&gt;&lt;br /&gt;  &lt;li&gt; List &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; Map &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;!-- Question 41 --&gt;&lt;br /&gt;&lt;li&gt; Which of these classes implement the Collection interface SortedMap. Select the one correct answers. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; HashMap &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; Hashtable&lt;/li&gt;&lt;br /&gt;  &lt;li&gt; TreeMap &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; HashSet &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; TreeSet &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; Vector &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; Which of the following are true about interfaces. Select the two correct answers. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; Methods declared in interfaces are implicitly private. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; Variables declared in interfaces are implicitly public, static, and final. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; An interface can extend any number of interfaces. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; The keyword implements indicate that an interface inherits from another. &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; Assume that class A extends class B, which extends class C. Also  all the three classes implement the method test(). How can a method in  a class A invoke the test() method defined in class C (without creating  a new instance of class C). Select the one correct answer. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; test(); &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; super.test(); &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; super.super.test(); &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; ::test(); &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; C.test(); &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; It is not possible to invoke test() method defined in C from a method in A. &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; What is the return type of method round(double d) defined in Math class. &lt;/li&gt;&lt;br /&gt;&lt;!-- Question 46 --&gt;&lt;br /&gt;&lt;li&gt; What gets written on the screen when the following program is compiled and run. Select the one right answer.&lt;/li&gt;&lt;br /&gt;&lt;pre&gt;  public class test {    &lt;br /&gt;public static void main(String args[]) {     &lt;br /&gt;int i;    &lt;br /&gt;float  f = 2.3f;    &lt;br /&gt;double d = 2.7;    &lt;br /&gt;i = ((int)Math.ceil(f)) * ((int)Math.round(d));       &lt;br /&gt;System.out.println(i);   &lt;br /&gt;}&lt;br /&gt;}    &lt;/pre&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; 4 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 5 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 6 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 6.1 &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; 9 &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; Is the following statement true or false. As the toString method  is defined in the Object class, System.out.println can be used to print  any object. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; true &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; false &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; Which of these classes defined in java.io and used for file-handling are abstract. Select the two correct answers. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; InputStream &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; PrintStream &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; Reader &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; FileInputStream &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; FileWriter &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; Name the collection interface used to represent collections that maintain unique elements. &lt;/li&gt;&lt;br /&gt;&lt;!-- Question 51 --&gt;&lt;br /&gt;&lt;li&gt; What is the result of compiling and running the following program. &lt;/li&gt;&lt;br /&gt;&lt;pre&gt;  public class test {    &lt;br /&gt;public static void main(String args[]) {        &lt;br /&gt;String str1="abc";       &lt;br /&gt;String str2="def";       &lt;br /&gt;String str3=str1.concat(str2);         &lt;br /&gt;str1.concat(str2);       &lt;br /&gt;System.out.println(str1);    &lt;br /&gt;} &lt;br /&gt;}    &lt;/pre&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; abc &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; def &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; abcabc &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; abcdef &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; defabc &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; abcdefdef &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; Select the one correct answer. The number of characters in an object of a class String is given by &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; The member variable called size &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; The member variable called length &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; The method size() returns the number of characters. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; The method length() returns the number of characters. &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; Select the one correct answer. Which method defined in Integer  class can be used to convert an Integer object to primitive int type. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; valueOf &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; intValue &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; getInt &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; getInteger &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; Name the return type of method hashCode() defined in Object class, which is used to get the unique hash value of an Object. &lt;/li&gt;&lt;br /&gt;&lt;li&gt; Which of the following are correct. Select the one correct answer.&lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; An import statement, if defined, must always be the first non-comment statement of the file. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; private members are accessible to all classes in the same package. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; An abstract class can be declared as final. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; Local variables cannot be declared as static. &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;!-- Question 56 --&gt;&lt;br /&gt;&lt;li&gt; Name the keyword that makes a variable belong to a class, rather  than being defined for each instance of the class. Select the one  correct answer. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; static &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; final &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; abstract &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; native &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; volatile &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; transient &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; Which of these are core interfaces in the collection framework. Select the one correct answer. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; Tree &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; Stack &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; Queue &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; Array &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; LinkedList &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; Map &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;!-- Question 50 -   --&gt;&lt;br /&gt;&lt;li&gt; Which of these statements are true. Select the two correct answers. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; For each try block there must be at least one catch block defined. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; A try block may be followed by any number of finally blocks. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; A try block must be followed by at least one finally or catch block. &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; If both catch and finally blocks are defined, catch block must precede the finally block. &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;p&gt; The remaining questions are related to AWT, event classes, and layout  managers. These topics are not included in 1.4 version of the exam. &lt;/p&gt;&lt;br /&gt;&lt;p&gt; &lt;/p&gt;&lt;br /&gt;&lt;li&gt; The default layout manager for a Frame is ... &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; FlowLayout &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; BorderLayout &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; GridLayout &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; GridBagLayout &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; CardLayout &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; Which of the following are valid adapter classes in Java. Select the two correct answers. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; ComponentAdapter &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; ActionAdapter &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; AdjustmentAdapter &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; ItemAdapter &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; FocusAdapter &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; Which method defined in the EventObject class returns the Object  that generated an event. The method should be given in the format -  return_type method_name(); &lt;/li&gt;&lt;br /&gt;&lt;li&gt; Which of the following object receives ActionEvent. Select the four correct answers. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; List &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; Button &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; Choice &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; CheckBox &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; TextField &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; MenuItem &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; Name the class that may be used to create submenus in pull-down menus. &lt;/li&gt;&lt;br /&gt;&lt;li&gt; In which class is the wait() method defined. Select the one correct answer. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; Applet &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; Runnable&lt;/li&gt;&lt;br /&gt;  &lt;li&gt; Thread &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; Object &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; Which is the only layout manager that always honors the size of a component. Select the one correct answer. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt; FlowLayout &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; GridLayout&lt;/li&gt;&lt;br /&gt;  &lt;li&gt; BorderLayout &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; CardLayout &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; GridBagLayout &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; Which of these are valid Event Listener interfaces. Select the two correct answers. &lt;/li&gt;&lt;br /&gt;&lt;ol type="A"&gt;&lt;br /&gt;  &lt;li&gt;MouseMotionListener&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;WindowListener&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;DialogListener&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;PaintListener&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt; Which abstract class is the super class of all menu-related classes. &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Answers to Sample Test 1 &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol type="1"&gt;&lt;br /&gt;&lt;!-- Answer 1 --&gt;&lt;br /&gt;&lt;li&gt; b &lt;/li&gt;&lt;br /&gt;&lt;li&gt; b, c, f &lt;/li&gt;&lt;br /&gt;&lt;li&gt; d. Note that the program gets one command line argument - 2.  args.length will get set to 1. So the condition if(args.length &amp;gt; 1)  will fail, and the second check if(args.length &amp;gt; 0) will return  true. &lt;/li&gt;&lt;br /&gt;&lt;li&gt; arr.length &lt;/li&gt;&lt;br /&gt;&lt;li&gt; Any of these is correct - 0x5, 0x05, 0X05, 0X5&lt;/li&gt;&lt;br /&gt;&lt;!-- Answer 6 --&gt;&lt;br /&gt;&lt;li&gt; b, c, f, g &lt;/li&gt;&lt;br /&gt;&lt;li&gt; a &lt;/li&gt;&lt;br /&gt;&lt;li&gt; d &lt;/li&gt;&lt;br /&gt;&lt;li&gt; "am" &lt;/li&gt;&lt;br /&gt;&lt;li&gt; a, c. Please note that b is not correct. A package statement may  appear before an import statement. A class constructor may be declared  private also. Hence d is incorrect.&lt;/li&gt;&lt;br /&gt;&lt;!-- Answer 11 --&gt;&lt;br /&gt;&lt;li&gt; a &lt;/li&gt;&lt;br /&gt;&lt;li&gt; a &lt;/li&gt;&lt;br /&gt;&lt;li&gt; protected &lt;/li&gt;&lt;br /&gt;&lt;li&gt; a, c &lt;/li&gt;&lt;br /&gt;&lt;li&gt; b, c &lt;/li&gt;&lt;br /&gt;&lt;!-- Answer 16 --&gt;&lt;br /&gt;&lt;li&gt; c &lt;/li&gt;&lt;br /&gt;&lt;li&gt; a, d, e &lt;/li&gt;&lt;br /&gt;&lt;li&gt; d, e &lt;/li&gt;&lt;br /&gt;&lt;li&gt; a, c &lt;/li&gt;&lt;br /&gt;&lt;li&gt; b, c &lt;/li&gt;&lt;br /&gt;&lt;!-- Answer 21 --&gt;&lt;br /&gt;&lt;li&gt; b, c, e &lt;/li&gt;&lt;br /&gt;&lt;li&gt; b &lt;/li&gt;&lt;br /&gt;&lt;li&gt; d &lt;/li&gt;&lt;br /&gt;&lt;!-- Answer 26 --&gt;&lt;br /&gt;&lt;li&gt; a &lt;/li&gt;&lt;br /&gt;&lt;li&gt; a&lt;/li&gt;&lt;br /&gt;&lt;li&gt; b, e . The option c is incorrect because a Java identifier name cannot begin with a digit. &lt;/li&gt;&lt;br /&gt;&lt;li&gt; d &lt;/li&gt;&lt;br /&gt;&lt;li&gt; c &lt;/li&gt;&lt;br /&gt;&lt;!-- Answer 31 --&gt;&lt;br /&gt;&lt;li&gt; c, d &lt;/li&gt;&lt;br /&gt;&lt;li&gt; a, c&lt;/li&gt;&lt;br /&gt;&lt;li&gt; b, d&lt;/li&gt;&lt;br /&gt;&lt;!-- Answer 36 --&gt;&lt;br /&gt;&lt;li&gt; b, c&lt;/li&gt;&lt;br /&gt;&lt;li&gt; c&lt;/li&gt;&lt;br /&gt;&lt;li&gt; c&lt;/li&gt;&lt;br /&gt;&lt;!-- Answer 41 --&gt;&lt;br /&gt;&lt;li&gt; c&lt;/li&gt;&lt;br /&gt;&lt;li&gt; b, c&lt;/li&gt;&lt;br /&gt;&lt;li&gt; f&lt;/li&gt;&lt;br /&gt;&lt;li&gt; long&lt;/li&gt;&lt;br /&gt;&lt;!-- Answer 46 --&gt;&lt;br /&gt;&lt;li&gt; e&lt;/li&gt;&lt;br /&gt;&lt;li&gt; a&lt;/li&gt;&lt;br /&gt;&lt;li&gt; a, c&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Set&lt;/li&gt;&lt;br /&gt;&lt;!-- Answer 51 --&gt;&lt;br /&gt;&lt;li&gt; a&lt;/li&gt;&lt;br /&gt;&lt;li&gt; d&lt;/li&gt;&lt;br /&gt;&lt;li&gt; b&lt;/li&gt;&lt;br /&gt;&lt;li&gt; int&lt;/li&gt;&lt;br /&gt;&lt;li&gt; d&lt;/li&gt;&lt;br /&gt;&lt;!-- Answer 56 --&gt;&lt;br /&gt;&lt;li&gt; a &lt;/li&gt;&lt;br /&gt;&lt;li&gt; f &lt;/li&gt;&lt;br /&gt;&lt;li&gt; c, d &lt;/li&gt;&lt;br /&gt;&lt;li&gt; b &lt;/li&gt;&lt;br /&gt;&lt;li&gt; a, e &lt;/li&gt;&lt;br /&gt;&lt;li&gt; Object getSource();&lt;/li&gt;&lt;br /&gt;&lt;li&gt; a, b, e, f&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Menu&lt;/li&gt;&lt;br /&gt;&lt;li&gt; d&lt;/li&gt;&lt;br /&gt;&lt;li&gt; a&lt;/li&gt;&lt;br /&gt;&lt;li&gt; a, b &lt;/li&gt;&lt;br /&gt;&lt;li&gt; MenuComponent &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7464055709054203132-2645418495915048234?l=project-java.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://project-java.blogspot.com/feeds/2645418495915048234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://project-java.blogspot.com/2009/02/mock-exam-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/2645418495915048234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/2645418495915048234'/><link rel='alternate' type='text/html' href='http://project-java.blogspot.com/2009/02/mock-exam-1.html' title='Mock exam 1'/><author><name>Son Rokhaniawan Perdata, S.T</name><uri>http://www.blogger.com/profile/17482607511048653600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_3PrCZQCxHao/SVJnUM5McbI/AAAAAAAAAHQ/4WvrWg1K28o/S220/son.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7464055709054203132.post-5653088897252086657</id><published>2009-02-20T00:16:00.000+07:00</published><updated>2009-02-20T00:18:34.414+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Making Http Simple Server With Java</title><content type='html'>&lt;p&gt;Praktikum's task Network and Apparatus Mathematics moves secondly be make one http simple server at localhost. With utilize SocketServer's function, therefore gets to be made one server which will wait â€œpanggilanâ€ on port 80 (HTTP). And will send html's code while called.&lt;/p&gt;&lt;p&gt;SocketServer works in one looping that perpetual to wait marks sense connection to go to port 80 on localhost. There is 4 constructor on SocketServer for example:&lt;br /&gt; &lt;/p&gt;&lt;ol&gt;&lt;li&gt;public ServerSocket(int port) throws BindException, IOException&lt;/li&gt;  &lt;li&gt;public ServerSocket(int port, int queueLength) throws BindException, IOException&lt;/li&gt;  &lt;li&gt;public ServerSocket(int port, int queueLength, InetAddress bindAddress) throws IOException&lt;/li&gt;  &lt;li&gt;public ServerSocket( ) throws IOException  // Java 1.4&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;span id="more-77"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;span id="fullpost"&gt;&lt;p&gt;n Java, to make one server gets to be done by trick as follows: &lt;/p&gt;&lt;ol&gt;&lt;li&gt;One serverSocket a new one is made deep one given port (in this case port 80) utilizing constructor of one SocketServer.&lt;/li&gt;  &lt;li&gt;Then serverSocket waits until mark sense coming connection through port has already is determined previous utilize accept's function(). &lt;/li&gt;  &lt;li&gt; Then depends from server type, well utilize getInputStream's function(), getOutputStream's function(), or both of ala function goes together to get input and output stream in order to gets communication with client. &lt;/li&gt;  &lt;li&gt; Server and client gets communication / get interaction until its time hang up connection.&lt;/li&gt;  &lt;li&gt; Server, Client or both hangs up connection &lt;/li&gt;  &lt;li&gt;Server returns to to step 2 and waiting until marks sense succeeding connections. &lt;/li&gt;&lt;/ol&gt;&lt;p&gt;And attachment source's following code that I takes from praktikum's module meagrely modifies to be able to qualify as one http server.&lt;/p&gt;&lt;p&gt;&lt;a href="http://d3ptzz.kandangbuaya.com/Serverku.java" title="download it" target="_blank"&gt;Serverku.java&lt;/a&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7464055709054203132-5653088897252086657?l=project-java.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://project-java.blogspot.com/feeds/5653088897252086657/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://project-java.blogspot.com/2009/02/making-http-simple-server-with-java.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/5653088897252086657'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/5653088897252086657'/><link rel='alternate' type='text/html' href='http://project-java.blogspot.com/2009/02/making-http-simple-server-with-java.html' title='Making Http Simple Server With Java'/><author><name>Son Rokhaniawan Perdata, S.T</name><uri>http://www.blogger.com/profile/17482607511048653600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_3PrCZQCxHao/SVJnUM5McbI/AAAAAAAAAHQ/4WvrWg1K28o/S220/son.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7464055709054203132.post-7058975156609302375</id><published>2009-02-20T00:03:00.000+07:00</published><updated>2009-02-20T00:13:00.175+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='Netbeans'/><title type='text'>Perusal and File Writing with Java</title><content type='html'>&lt;p&gt;A few days ago, my friend asks for to help her works PR its Programming. PR's problem terminologicals i am goodly difficult also, since I newbie in programming. Programming languages who may be utilized is C,C++, Java. And since i am java person, therefore I choose to utilize Java.hehe.. Since I really be intend to study Java language. &lt;/p&gt;&lt;p&gt;Problem PR is we make program who will read one input file  “indata.txt”, one that meaty word which will at test do correspond to order, if accords therefore that diwrite will into one file  “legalwords.txt”, conversely if incorrectly will at write into file “badwords.txt”. Among word one by another word in file   “indata.txt” came to pieces by one tabulator, on my program, I utilize tabulator tab(\t). Order that is utilized for mengetest to say is&lt;br /&gt;&lt;br /&gt; a. first syllable may not as numeral as.&lt;br /&gt; b. say has less than 8 characters.&lt;br /&gt; c. say just may lap over of  letter (a..z, A..Z), number (0..9), atau simbol underscore(’_').&lt;br /&gt;&lt;br /&gt; Since I newbie in Java,and was wonted utilizes it, requiring time rather long time to think up syntax syntax that is used. On progam I, its program path is as follows:&lt;br /&gt;&lt;br /&gt; a. Make one  BufferedReader for FileReader(”indata.txt”).  Make PrintWritter for FileWriter legalwords.txt and badwords.txt.&lt;br /&gt; b. Then by use of  StringTokenizer to account word amount in file  indata.txt.&lt;br /&gt; c. After knows total token / says, therefore then with looping to check about word / token, what appropriate ruling or not.&lt;br /&gt;d. Then afters is sorted, therefore word suitably at write goes to  legalwords.txt, and unsuitably diwrite goes to badwords.txt&lt;/p&gt;&lt;span id="fullpost"&gt;&lt;p&gt;And this is result running programs my version:&lt;br /&gt; 1. Input File&lt;br /&gt;&lt;br /&gt; &lt;img src="http://triharyanto-ps.web.ugm.ac.id/dept/images/java1.jpg" alt="Input File" /&gt;&lt;br /&gt;&lt;br /&gt; 2. Legal Words&lt;br /&gt;&lt;br /&gt; &lt;img src="http://triharyanto-ps.web.ugm.ac.id/dept/images/java3.jpg" alt="Input File" /&gt;&lt;br /&gt;&lt;br /&gt; 3. Bad Words&lt;br /&gt;&lt;br /&gt;&lt;img src="http://triharyanto-ps.web.ugm.ac.id/dept/images/java2.jpg" alt="Input File" /&gt;&lt;/p&gt;&lt;p&gt;On Compile NetBeans&lt;br /&gt;&lt;br /&gt;&lt;img src="http://triharyanto-ps.web.ugm.ac.id/dept/images/java4.jpg" alt="Input File" /&gt;&lt;/p&gt;&lt;p&gt;And this following is source code programs what do I make. Its correction appeal if available fault.&lt;br /&gt;&lt;br /&gt; &lt;a href="http://triharyanto-ps.web.ugm.ac.id/dept/source/java1.rar"&gt;DOWNLOAD&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7464055709054203132-7058975156609302375?l=project-java.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://project-java.blogspot.com/feeds/7058975156609302375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://project-java.blogspot.com/2009/02/perusal-and-file-writing-with-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/7058975156609302375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/7058975156609302375'/><link rel='alternate' type='text/html' href='http://project-java.blogspot.com/2009/02/perusal-and-file-writing-with-java.html' title='Perusal and File Writing with Java'/><author><name>Son Rokhaniawan Perdata, S.T</name><uri>http://www.blogger.com/profile/17482607511048653600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_3PrCZQCxHao/SVJnUM5McbI/AAAAAAAAAHQ/4WvrWg1K28o/S220/son.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7464055709054203132.post-3727545006200912809</id><published>2009-02-19T23:35:00.002+07:00</published><updated>2009-02-20T00:00:06.694+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Tips Java : Getting Address's IP and Host Name</title><content type='html'>&lt;p&gt;Java provides InetAddress's function to get host's internet protocol address and also name a computer. host's internet protocol address and also name that is gotten don't cling to host's internet protocol address and name local computer only, but can also be utilized for mengecek host's internet protocol address and name at Internet, obviously by condition of computer we most link with Internet. This logistic purpose also relates hand in glove with setting DNS on computer that we utilizes.&lt;/p&gt;Following is sample program that points out fungsionalitas that:&lt;br /&gt;   &lt;ol&gt;&lt;li&gt;Make one project is Netbeans new &lt;/li&gt;&lt;br /&gt;   &lt;li&gt;Add one JFrame Form&lt;/li&gt;&lt;br /&gt;   &lt;li&gt;Provede with 2 tags, 2 numbers  TextField (txtIPAddress dan  txtNamaHost) and 3 Button (btnCheckIPAddress, btnCheckHostName dan  btnCheckLokal). See example on pictured following: &lt;img src="http://www.vavai.com/images/java/nb-hostname41.png" alt="" /&gt;&lt;/li&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;&lt;li&gt;Following code cannikin type on btnCheckHostName, event actionPerformed&lt;br /&gt;&lt;br /&gt;     &lt;div&gt;&lt;ol start="1"&gt;&lt;li&gt;&lt;span style="font-size:78%;"&gt;private void btnCheckHostNameActionPerformed(java.awt.event.ActionEvent evt) {  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;          &lt;li&gt;&lt;span style="font-size:78%;"&gt;        try {  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;          &lt;li&gt;&lt;span style="font-size:78%;"&gt;            String strHostName = InetAddress.getByName(txtIPAddress.getText()).getHostName();  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;          &lt;li&gt;&lt;span style="font-size:78%;"&gt;            JOptionPane.showMessageDialog(null, "Host name dari IP Address '" + txtIPAddress.getText() +"' =&lt;br /&gt;"+ strHostName);  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;          &lt;li&gt;&lt;span style="font-size:78%;"&gt;        } catch (UnknownHostException ex) {  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;          &lt;li&gt;&lt;span style="font-size:78%;"&gt;            JOptionPane.showMessageDialog(null, ex);  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;          &lt;li&gt;&lt;span style="font-size:78%;"&gt;            Logger.getLogger(frmIpAddress.class.getName()).log(Level.SEVERE, null, ex);  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;          &lt;li&gt;&lt;span style="font-size:78%;"&gt;  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;          &lt;li&gt;&lt;span style="font-size:78%;"&gt;        }  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;          &lt;li&gt;&lt;span style="font-size:78%;"&gt;  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;          &lt;li&gt;&lt;span style="font-size:78%;"&gt;    }  &lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;         &lt;br /&gt;     &lt;/div&gt;&lt;/li&gt;&lt;br /&gt;   &lt;li&gt;Do import library that needful  (import java.net.InetAddress; import javax.swing.JOptionPane;)&lt;/li&gt;&lt;br /&gt;   &lt;li&gt;Following code cannikin type on btnCheckIPAddress, event actionPerformed&lt;br /&gt;     &lt;div&gt;&lt;br /&gt;&lt;ol start="1"&gt;&lt;br /&gt;         &lt;li&gt;&lt;span style="font-size:78%;"&gt;private void btnCheckIPAddressActionPerformed(java.awt.event.ActionEvent evt) {  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;          &lt;li&gt;&lt;span style="font-size:78%;"&gt;  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;          &lt;li&gt;&lt;span style="font-size:78%;"&gt;        try {  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;          &lt;li&gt;&lt;span style="font-size:78%;"&gt;            String strIPAddress = InetAddress.getByName(txtHostName.getText()).getHostAddress() ;  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;          &lt;li&gt;&lt;span style="font-size:78%;"&gt;            JOptionPane.showMessageDialog(null, "Alamat IP dari '"+txtHostName.getText() +"' ="+  strIPAddress);  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;          &lt;li&gt;&lt;span style="font-size:78%;"&gt;        } catch (UnknownHostException ex) {  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;          &lt;li&gt;&lt;span style="font-size:78%;"&gt;            JOptionPane.showMessageDialog(null, ex);  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;          &lt;li&gt;&lt;span style="font-size:78%;"&gt;            Logger.getLogger(frmIpAddress.class.getName()).log(Level.SEVERE, null, ex);  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;          &lt;li&gt;&lt;span style="font-size:78%;"&gt;  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;          &lt;li&gt;&lt;span style="font-size:78%;"&gt;        }  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;          &lt;li&gt;&lt;span style="font-size:78%;"&gt;    }  &lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;       &lt;br /&gt;     &lt;/div&gt;&lt;/li&gt;&lt;br /&gt;   &lt;li&gt;Following code cannikin type on btnCheckLokal event actionPerformed&lt;/li&gt;    &lt;div&gt;&lt;ol start="1"&gt;&lt;br /&gt;       &lt;li&gt;&lt;span style="font-size:78%;"&gt;private void btnCheckLocalActionPerformed(java.awt.event.ActionEvent evt) {  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;        &lt;li&gt;&lt;span style="font-size:78%;"&gt;         try {  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;        &lt;li&gt;&lt;span style="font-size:78%;"&gt;            InetAddress AlamatInternet = InetAddress.getLocalHost();  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;        &lt;li&gt;&lt;span style="font-size:78%;"&gt;            JOptionPane.showMessageDialog(null, "Host name lokal : " +AlamatInternet.getHostName());  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;        &lt;li&gt;&lt;span style="font-size:78%;"&gt;            JOptionPane.showMessageDialog(null, "IP Address lokal : " +AlamatInternet.getHostAddress() );  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;        &lt;li&gt;&lt;span style="font-size:78%;"&gt;        } catch (UnknownHostException ex) {  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;        &lt;li&gt;&lt;span style="font-size:78%;"&gt;            JOptionPane.showMessageDialog(null, ex);  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;        &lt;li&gt;&lt;span style="font-size:78%;"&gt;            Logger.getLogger(frmIpAddress.class.getName()).log(Level.SEVERE, null, ex);  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;        &lt;li&gt;&lt;span style="font-size:78%;"&gt;  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;        &lt;li&gt;&lt;span style="font-size:78%;"&gt;        }  &lt;/span&gt;&lt;/li&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;        &lt;li&gt;&lt;span style="font-size:78%;"&gt;    }  &lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;  &lt;br /&gt;   &lt;li&gt;Save and runs application  (SHIFT + F6). Insert  IP Address and click on “Check Host Name” or insert host name and click “Check IP  Address”. Check IP and Host Local don't need entry. Following is umpteen screenshot message one that performs:&lt;br /&gt;&lt;br /&gt;     &lt;img src="http://www.vavai.com/images/java/nb-hostname1.png" alt="" /&gt;&lt;br /&gt;     &lt;p&gt;&lt;img src="http://www.vavai.com/images/java/nb-hostname2.png" alt="" /&gt;&lt;/p&gt;&lt;br /&gt;     &lt;p&gt;&lt;img src="http://www.vavai.com/images/java/nb-hostname3.png" alt="" /&gt;&lt;/p&gt;This program not smart's ala detect entry what that internet protocol address or host name. To easy, I utilize 2 numbers TextField for example. On terapan's application, input IP Address  or Host Name can thru get variable.&lt;/li&gt;&lt;/span&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7464055709054203132-3727545006200912809?l=project-java.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://project-java.blogspot.com/feeds/3727545006200912809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://project-java.blogspot.com/2009/02/tips-java-getting-addresss-ip-and-host.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/3727545006200912809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/3727545006200912809'/><link rel='alternate' type='text/html' href='http://project-java.blogspot.com/2009/02/tips-java-getting-addresss-ip-and-host.html' title='Tips Java : Getting Address&apos;s IP and Host Name'/><author><name>Son Rokhaniawan Perdata, S.T</name><uri>http://www.blogger.com/profile/17482607511048653600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_3PrCZQCxHao/SVJnUM5McbI/AAAAAAAAAHQ/4WvrWg1K28o/S220/son.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7464055709054203132.post-7302619568786101993</id><published>2009-02-16T00:08:00.003+07:00</published><updated>2009-02-16T00:21:51.035+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><title type='text'>Creating an AJAX-Enabled Calendar Control</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://aspnet.4guysfromrolla.com/images/ccajax1.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 280px; height: 185px;" src="http://aspnet.4guysfromrolla.com/images/ccajax1.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Introduction&lt;/span&gt;&lt;br /&gt;Go to any travel or event booking website and you'll find the same user interface for collecting date information: the Calendar. Providing such an interface in an ASP.NET application is a breeze, thanks to the built-in Calendar Web control. There are two downsides to ASP.NET's Calendar control: first, it is not very useful when selecting dates far into the future or past, as you can only navigate to the next or previous month; and, second, the Calendar does not use AJAX techniques, so each click, be it selecting a date or moving to the next or previous month, requires a full postback.&lt;br /&gt;&lt;br /&gt;Mehmet Genc addressed this first shortcoming in Extending the Calendar Control's Date Navigation by showing how to add month and year drop-down lists. But Mehmet's article was written in 2004 and since then AJAX-enabled websites have become all the rage. I decided it was high time to update Mehmet's custom Calendar control to support AJAX. Specifically, I implemented the AJAX-enabled Calendar control as a User Control. The User Control renders a TextBox control that, when clicked, displays a Calendar control from which the user can select the date. Like with Mehmet's Calendar, users can quickly jump to a particular month or year by using two drop-down lists. And best of all, the user experience is very responsive.&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;First Things First: Ensuring Your Environment Supports ASP.NET AJAX&lt;/span&gt;&lt;br /&gt;To use this AJAX-enabled Calendar control, make sure your development environment supports the ASP.NET AJAX framework. If you are using Visual Studio 2008, then this framework is already present. If, however, you are using Visual Studio 2005, then you need to download and install the ASP.NET AJAX framework from Microsoft's site, http://www.asp.net/ajax/. For more information on this process, refer to Scott Mitchell's article, AJAX Basics and Getting Started with Microsoft's ASP.NET AJAX Framework.&lt;br /&gt;&lt;br /&gt;My AJAX-enabled Calendar control uses the UpdatePanel and PopupControlExtender controls. While the UpdatePanel is part of the framework's "Essential Components," the PopupControlExtender is part of the ASP.NET AJAX Control Toolkit, which is a separate download (even for Visual Studio 2008). If you check out the Control Toolkit samples you'll notice that there's an AJAX Calendar control in the Toolkit. I built my own AJAX-enabled Calendar control instead of using the one in the Control Toolkit because I wanted to add the month/year drop-down lists. Also, there have been a variety of display bugs with the Calendar control (see the AJAX Control Toolkit work item list). I invite you to try out mine and the AJAX Control Toolkit's Calendar and use the one that's best suited for your needs.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Getting Started with My AJAX-Enabled Calendar Control&lt;/span&gt;&lt;br /&gt;The complete code for this User Control, along with a sample web page, is available at the end of this article. You should be able to open the folder as a website in either Visual Studio 2005 or Visual Studio 2008.&lt;br /&gt;&lt;br /&gt;The Calendar is implemented in the CoolCalendar.ascx file as a User Control. Take a moment to examine the markup in this page. You'll find the following key controls:&lt;br /&gt;&lt;br /&gt;1. The DateTextFrom TextBox&lt;br /&gt;2. A RequiredFieldValidator named DateTextFromRequired&lt;br /&gt;3. A Panel control&lt;br /&gt;4. An UpdatePanel control&lt;br /&gt;5. The month and year DropDownList controls&lt;br /&gt;6. The Calendar control&lt;br /&gt;7. An AJAX PopupControlExtender control&lt;br /&gt;&lt;br /&gt;There are a few of these controls that warrant further discussion. Take note of the markup for the &lt;code&gt;DateTextFrom&lt;/code&gt; TextBox control (item 1): &lt;p&gt;&lt;table border="0" width="95%"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#cccccc" width="100%"&gt; &lt;code&gt; &lt;asp:textbox id="DateTextFrom" text="" runat="server" onfocus="javascript:this.blur();" width="80" autocomplete="off"&gt; &lt;/asp:textbox&gt;&lt;/code&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;/p&gt; Note the &lt;code&gt;onfocus="javascript:this.blur();"&lt;/code&gt;.&lt;p&gt; This bit of client-side script ensures that whenever the user clicks on the &lt;code&gt;DateTextFrom&lt;/code&gt; TextBox, focus is immediately taken away from the control. The idea here - as we'll see shortly - is that whenever the user focuses on the TextBox it is immediately taken away and the Calendar control is displayed. This forces the user to select a date from the calendar. If you remove the &lt;code&gt;onfocus&lt;/code&gt; script, the user could enter the date into the TextBox via the keyboard. I find this option undesirable due to the possibility of user entry errors. &lt;/p&gt;&lt;p&gt;The RequiredFieldValidator (item 2) is used to optionally ensure that a date value has been supplied. The User Control contains a Boolean public property named &lt;code&gt;DateTextRequired&lt;/code&gt;. Setting this value to True enables the RequiredFieldValidator; setting it to False disables it. By default, the RequiredFieldValidator is enabled. &lt;/p&gt;&lt;p&gt;The AJAX PopupControlExtender control pops up a particular Panel on the page in response to a certain client-side action. The Panel control (item 3) defines the region that is popped up, and includes the UpdatePanel (item 4), the month/year DropDownLists (item 5), and the Calendar control (item 6). &lt;/p&gt;&lt;p&gt;The final piece in the markup page is the PopupControlExtender control (item 7) and is configured to display the Panel (item 3) whenever the &lt;code&gt;DateTextFrom&lt;/code&gt; TextBox receives focus. This behavior is dictated entirely through the PopupControlExtender control's properties, there's no need to write any JavaScript or code! &lt;/p&gt;&lt;p&gt;&lt;table border="0" width="95%"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#cccccc" width="100%"&gt; &lt;code&gt; &lt;ajaxtoolkit:popupcontrolextender id="PopupControlExtender1" runat="server" targetcontrolid="DateTextFrom" popupcontrolid="Panel1" position="Bottom"&gt; &lt;/ajaxtoolkit:popupcontrolextender&gt;&lt;/code&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;/p&gt; For more information on the PopupControlExtender see the &lt;a href="http://www.asp.net/AJAX/AjaxControlToolkit/Samples/PopupControl/PopupControl.aspx"&gt;PopupControlExtender Demonstration&lt;/a&gt;. Also check out &lt;a href="mailto:brian@brianandjeannesmith.com"&gt;Brian Smith&lt;/a&gt;'s article&lt;p&gt;, &lt;a href="http://aspnet.4guysfromrolla.com/articles/070407-1.aspx"&gt;Displaying Extended Details in  a GridView Using an Ajax Pop-Up&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt; &lt;b&gt;Examining the AJAX-Enabled Calendar Control's Code&lt;/b&gt;&lt;br /&gt;The User Control's code-behind class defines a couple of properties and includes the code to populate the month/year DropDownLists and the user's interactions with the Calendar. The most important property is the &lt;code&gt;DateTextFromValue&lt;/code&gt;, which sets or gets the selected date. This property simply reads and writes its value to the &lt;code&gt;DateTextFrom&lt;/code&gt; TextBox. &lt;/p&gt;&lt;p&gt;&lt;table border="0" width="95%"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#cccccc" width="100%"&gt; &lt;code&gt; public string DateTextFromValue&lt;br /&gt;{&lt;br /&gt; get { return DateTextFrom.Text; }&lt;br /&gt; set { DateTextFrom.Text = value; }&lt;br /&gt;} &lt;/code&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;/p&gt;&lt;p&gt; &lt;i&gt;&lt;b&gt;Note:&lt;/b&gt; The code available for download at the end of this article includes a VB and C# version of the User Control...&lt;/i&gt; &lt;/p&gt;&lt;p&gt; Two additional properties are defined for specifying whether the RequiredFieldValidator should be enabled (&lt;code&gt;DateTextRequired&lt;/code&gt;) and the error message to display if the required date value is not supplied (&lt;code&gt;DateTextRequiredText&lt;/code&gt;). &lt;/p&gt;&lt;p&gt; The month and year DropDownLists are populated by the &lt;code&gt;Populate_MonthList&lt;/code&gt; and &lt;code&gt;Populate_YearList&lt;/code&gt; methods, which are called on the first page visit. These methods were taken directly from Mehmet's article. &lt;code&gt;Populate_MonthList&lt;/code&gt; returns a list of month names (January, February, ...) while &lt;code&gt;Populate_YearList&lt;/code&gt; populates the DropDownList with years from 20 years ago to one year in the future. &lt;/p&gt;&lt;p&gt; When the month or year DropDownList is changed, a partial page postback occurs and the &lt;code&gt;Set_Calendar&lt;/code&gt; method is executed. The &lt;code&gt;Set_Calendar&lt;/code&gt; method sets the Calendar control's &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.calendar.todaysdate.aspx"&gt;&lt;code&gt;TodaysDate&lt;/code&gt; property&lt;/a&gt; to the first of the selected month/year. &lt;/p&gt;&lt;p&gt;&lt;table border="0" width="95%"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#cccccc" width="100%"&gt; &lt;code&gt; public void Set_Calendar(object Sender, EventArgs E)&lt;br /&gt;{&lt;br /&gt; string theDate = drpCalMonth.SelectedItem.Value + " 1, " + drpCalYear.SelectedItem.Value;&lt;br /&gt;&lt;br /&gt; DateTime dtFoo;&lt;br /&gt; dtFoo = System.Convert.ToDateTime(theDate);&lt;br /&gt;&lt;br /&gt; Calendar1.TodaysDate = dtFoo;&lt;br /&gt;} &lt;/code&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;/p&gt;&lt;p&gt; Whenever the user selects a date within the Calendar, a partial page postback transpires and the Calendar's &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.calendar.selectionchanged.aspx"&gt;&lt;code&gt;SelectionChanged&lt;/code&gt;  event&lt;/a&gt; is fired. The &lt;code&gt;Calendar1_SelectionChanged&lt;/code&gt; event handler calls the PopupControlExtender control's &lt;code&gt;Commit&lt;/code&gt; method, passing in the  Calendar's &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.calendar.selecteddate.aspx"&gt;&lt;code&gt;SelectedDate&lt;/code&gt; property&lt;/a&gt;.  The net effect is that the Calendar popup disappears and the selected date is display in the TextBox. &lt;/p&gt;&lt;p&gt;&lt;table border="0" width="95%"&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#cccccc" width="100%"&gt; &lt;code&gt; protected void Calendar1_SelectionChanged(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt; PopupControlExtender1.Commit(Calendar1.SelectedDate.ToShortDateString());&lt;br /&gt;} &lt;/code&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;/p&gt;&lt;p&gt; &lt;b&gt;My AJAX-Enabled Calendar Web Control In Action&lt;/b&gt;&lt;br /&gt;The download at the end of this article includes a simple demo page, &lt;code&gt;TestCoolCalendar.aspx&lt;/code&gt;. The demo illustrates how to use the User Control's &lt;code&gt;DateTextRequired&lt;/code&gt; and &lt;code&gt;DateTextRequiredText&lt;/code&gt; properties to require a date and show a custom error message. In addition to the User Control, the &lt;code&gt;TestCoolCalendar.aspx&lt;/code&gt; includes a Save button that, when clicked, displays the value selected from the Calendar control. This value is retrieved via the User Control's &lt;code&gt;DateTextFromValue&lt;/code&gt; property. &lt;/p&gt;&lt;p&gt; &lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;In this article we saw how to use the ASP.NET AJAX framework's UpdatePanel and the AJAX Control Toolkit's PopupControlExtender to turn the built-in Calendar control into a richer, AJAX-enabled version. This control is implemented as a User Control, making it a cinch to add to your projects. Thanks again to  Mehmet Genc for the initial inspiration and to Scott Mitchell for publishing this article. &lt;/p&gt;&lt;p&gt; Happy Programming!&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7464055709054203132-7302619568786101993?l=project-java.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://project-java.blogspot.com/feeds/7302619568786101993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://project-java.blogspot.com/2009/02/creating-ajax-enabled-calendar-control.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/7302619568786101993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/7302619568786101993'/><link rel='alternate' type='text/html' href='http://project-java.blogspot.com/2009/02/creating-ajax-enabled-calendar-control.html' title='Creating an AJAX-Enabled Calendar Control'/><author><name>Son Rokhaniawan Perdata, S.T</name><uri>http://www.blogger.com/profile/17482607511048653600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_3PrCZQCxHao/SVJnUM5McbI/AAAAAAAAAHQ/4WvrWg1K28o/S220/son.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7464055709054203132.post-8126668764991406300</id><published>2009-02-14T14:00:00.002+07:00</published><updated>2009-02-14T14:09:13.121+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Project'/><title type='text'>Calculator modestly with Swing</title><content type='html'>&lt;img src="http://nagasakti.mervpolis.com/roller/bagussuwandi/resource/gambar/Calculator.png" align="bottom" border="0" hspace="0" vspace="0" /&gt;&lt;br /&gt;&lt;br /&gt;Swing is one of technology in Java to make one application desktop. This following I load one simple example with swing. One calculator plain. I utilize two numbers class. Class first is that of penampil frame and class second is program from that calculator is alone.&lt;br /&gt;&lt;br /&gt;Its example following:&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;&lt;p&gt;&lt;i&gt;package testing;&lt;br /&gt;&lt;br /&gt;import java.awt.*;&lt;br /&gt;import java.awt.event.*;&lt;br /&gt;import javax.swing.*;&lt;br /&gt;import javax.swing.event.*;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; *&lt;br /&gt; * @author bagus&lt;br /&gt; */&lt;br /&gt;public class SwingCalculator {&lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;        JFrame frame = new Calculator();&lt;br /&gt;        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);&lt;br /&gt;        frame.setVisible(true);&lt;br /&gt;    }&lt;br /&gt;}&lt;/i&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;Then remakes one class at same package&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;i&gt;package testing;&lt;br /&gt;&lt;br /&gt;import java.awt.*;&lt;br /&gt;import java.awt.event.*;&lt;br /&gt;import javax.swing.*;&lt;br /&gt;import javax.swing.event.*;&lt;br /&gt;/**&lt;br /&gt; *&lt;br /&gt; * @author bagus&lt;br /&gt; */&lt;br /&gt;class Calculator extends JFrame {&lt;br /&gt;  private final Font BIGGER_FONT = new Font("monspaced", Font.PLAIN, 20);&lt;br /&gt;  private JTextField textfield;      &lt;br /&gt;  private boolean   number = true; &lt;br /&gt;  private String    equalOp  = "="; &lt;br /&gt;  private CalculatorOp op = new CalculatorOp();&lt;br /&gt;&lt;br /&gt;  public Calculator() {&lt;br /&gt;  textfield = new JTextField("0", 12);&lt;br /&gt;  textfield.setHorizontalAlignment(JTextField.RIGHT);&lt;br /&gt;  textfield.setFont(BIGGER_FONT);&lt;br /&gt; &lt;br /&gt;  ActionListener numberListener = new NumberListener();&lt;br /&gt;  String buttonOrder = "1234567890 ";&lt;br /&gt;  JPanel buttonPanel = new JPanel();&lt;br /&gt;  buttonPanel.setLayout(new GridLayout(4, 4, 4, 4));&lt;br /&gt;    for (int i = 0; i &lt; buttonOrder.length(); i++) {&lt;br /&gt;            String key = buttonOrder.substring(i, i+1);&lt;br /&gt;            if (key.equals(" ")) {&lt;br /&gt;                buttonPanel.add(new JLabel(""));&lt;br /&gt;            } else {&lt;br /&gt;                JButton button = new JButton(key);&lt;br /&gt;                button.addActionListener(numberListener);&lt;br /&gt;                button.setFont(BIGGER_FONT);&lt;br /&gt;        buttonPanel.add(button);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;  ActionListener operatorListener = new OperatorListener();&lt;br /&gt;  JPanel panel = new JPanel();&lt;br /&gt;  panel.setLayout(new GridLayout(4, 4, 4, 4));&lt;br /&gt;  String[] opOrder = {"+", "-", "*", "/","=","C"};&lt;br /&gt;   for (int i = 0; i &lt; opOrder.length; i++) {&lt;br /&gt;    JButton button = new JButton(opOrder[i]);&lt;br /&gt;    button.addActionListener(operatorListener);&lt;br /&gt;    button.setFont(BIGGER_FONT);&lt;br /&gt;  panel.add(button);&lt;br /&gt;    }&lt;br /&gt;   JPanel pan = new JPanel();&lt;br /&gt;        pan.setLayout(new BorderLayout(4, 4));&lt;br /&gt;        pan.add(textfield, BorderLayout.NORTH );&lt;br /&gt;        pan.add(buttonPanel   , BorderLayout.CENTER);&lt;br /&gt;        pan.add(panel , BorderLayout.EAST  );&lt;br /&gt;        this.setContentPane(pan);&lt;br /&gt;        this.pack();&lt;br /&gt;        this.setTitle("Calculator");&lt;br /&gt;        this.setResizable(false);&lt;br /&gt;    }&lt;br /&gt;        private void action() {&lt;br /&gt;        number = true;        &lt;br /&gt;        textfield.setText("0");&lt;br /&gt;        equalOp  = "=";&lt;br /&gt;        op.setTotal("0");&lt;br /&gt;  }&lt;br /&gt;  class OperatorListener implements ActionListener {&lt;br /&gt;        public void actionPerformed(ActionEvent e) {&lt;br /&gt;        if (number) {&lt;br /&gt;                action();&lt;br /&gt;                textfield.setText("0");&lt;br /&gt;            } else {&lt;br /&gt;                number = true;&lt;br /&gt;                String displayText = textfield.getText();&lt;br /&gt;                if (equalOp.equals("=")) {&lt;br /&gt;                        op.setTotal(displayText);&lt;br /&gt;                    } else if (equalOp.equals("+")) {&lt;br /&gt;                        op.add(displayText);&lt;br /&gt;                    } else if (equalOp.equals("-")) {&lt;br /&gt;                        op.subtract(displayText);&lt;br /&gt;                    } else if (equalOp.equals("*")) {&lt;br /&gt;                        op.multiply(displayText);&lt;br /&gt;                    } else if (equalOp.equals("/")) {&lt;br /&gt;                        op.divide(displayText);&lt;br /&gt;                    }&lt;br /&gt;                   textfield.setText("" + op.getTotalString());&lt;br /&gt;                   equalOp = e.getActionCommand();&lt;br /&gt;            }&lt;br /&gt;           }&lt;br /&gt;           }&lt;br /&gt;    class NumberListener implements ActionListener {&lt;br /&gt;        public void actionPerformed(ActionEvent event) {&lt;br /&gt;            String digit = event.getActionCommand();&lt;br /&gt;            if (number) {&lt;br /&gt;              textfield.setText(digit);&lt;br /&gt;              number = false;&lt;br /&gt;            } else {&lt;br /&gt;             textfield.setText(textfield.getText() + digit);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;  public class CalculatorOp {&lt;br /&gt;   &lt;br /&gt;private int total;  &lt;br /&gt;public CalculatorOp() {&lt;br /&gt;        total = 0;&lt;br /&gt;    }&lt;br /&gt;   public String getTotalString() {&lt;br /&gt;        return ""+total;&lt;br /&gt;    }&lt;br /&gt;   public void setTotal(String n) {&lt;br /&gt;        total = convertToNumber(n);&lt;br /&gt;    }&lt;br /&gt;   public void add(String n) {&lt;br /&gt;        total += convertToNumber(n);&lt;br /&gt;   }&lt;br /&gt;   public void subtract(String n) {&lt;br /&gt;        total -= convertToNumber(n);&lt;br /&gt;    }&lt;br /&gt;   public void multiply(String n) {&lt;br /&gt;        total *= convertToNumber(n);&lt;br /&gt;    }&lt;br /&gt;   public void divide(String n) {&lt;br /&gt;        total /= convertToNumber(n);&lt;br /&gt;    }&lt;br /&gt;   private int convertToNumber(String n) {&lt;br /&gt;        return Integer.parseInt(n);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;}&lt;/i&gt; &lt;i&gt;&lt;br /&gt;&lt;br /&gt;Its output result is as follows:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://nagasakti.mervpolis.com/roller/bagussuwandi/resource/gambar/Calculator.png" align="bottom" border="0" hspace="0" vspace="0" /&gt;&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;i&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7464055709054203132-8126668764991406300?l=project-java.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://project-java.blogspot.com/feeds/8126668764991406300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://project-java.blogspot.com/2009/02/calculator-modestly-with-swing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/8126668764991406300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/8126668764991406300'/><link rel='alternate' type='text/html' href='http://project-java.blogspot.com/2009/02/calculator-modestly-with-swing.html' title='Calculator modestly with Swing'/><author><name>Son Rokhaniawan Perdata, S.T</name><uri>http://www.blogger.com/profile/17482607511048653600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_3PrCZQCxHao/SVJnUM5McbI/AAAAAAAAAHQ/4WvrWg1K28o/S220/son.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7464055709054203132.post-2798523829762766940</id><published>2009-02-11T23:32:00.003+07:00</published><updated>2009-02-11T23:52:28.421+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Project'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><title type='text'>Create Database with Netbeans Program and Ms.Access</title><content type='html'>Hi all readers, this project we will create a database program using Netbeans IDE 6.5 Database and Ms.Access. Software may Netbeans is new for us. Yes the actual program Netbeans is a software used to create a program based on JAVA. We still use the first appearance of white Notepad to create JAVA applications. Akan NotePad but parallel development is replaced by slow start because TEXTPAD facilities provided by this TEXTPAD seems more complete and informative than the notepad. But when we look kebelakang shortages have appeared TEXTPAD again, that is we still have to type the script to make the program components. And that lack is covered by the Netbeans this. Namely to provide component parts without having to type the script to make the withdrawal other GUI Programming Languages. You can create our new project, we:&lt;br /&gt;&lt;br /&gt;Here the view that the program will be created:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;" class="gallery"&gt;&lt;a href="http://haryansyah.ppkia.ac.id/wp-content/uploads/2008/05/form-layout.jpg"&gt;&lt;img title="form-layout" src="http://haryansyah.ppkia.ac.id/wp-content/uploads/2008/05/form-layout-300x177.jpg" height="177" width="300" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The Steps:&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;***&gt; Create database tables and cooperation with the Member as follows:&lt;br /&gt;&lt;br /&gt;&lt;p style="text-align: justify;"&gt;==================================================================&lt;/p&gt; &lt;p style="text-align: justify;"&gt;Noang - Text - 5&lt;/p&gt; &lt;p style="text-align: justify;"&gt;Nama - Text - 25&lt;/p&gt; &lt;p style="text-align: justify;"&gt;Alamat - Text - 30&lt;/p&gt; &lt;p style="text-align: justify;"&gt;Jkel - Yes/no&lt;/p&gt; &lt;p style="text-align: justify;"&gt;Agama - Text - 1&lt;/p&gt; &lt;p style="text-align: justify;"&gt;NoKTP - Text - 15&lt;/p&gt; &lt;p style="text-align: justify;"&gt;NoTelp - Text - 12&lt;/p&gt; &lt;p style="text-align: justify;"&gt;Simpanan - Number - LongInt&lt;/p&gt; ============================================================&lt;br /&gt;&lt;br /&gt;1. Create a design form as shown in the picture. In the form there is a component JTextField, JComboBox, JRadioButton, JPanel, JButton.&lt;br /&gt;2. Change the name of the components that we have entered, especially for components JTextField, JComboBox, JButton, JRadioButton engan way and conditions as follows:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;" class="gallery"&gt;&lt;a href="http://haryansyah.ppkia.ac.id/wp-content/uploads/2008/05/change-variable-name.jpg"&gt;&lt;img title="change-variable-name" src="http://haryansyah.ppkia.ac.id/wp-content/uploads/2008/05/change-variable-name-300x211.jpg" height="211" width="300" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;div style="text-align: left;" id="result_box" dir="ltr"&gt;on the project, this time using the provisions of author names the following components to facilitate understanding in making the program code.&lt;br /&gt;&lt;br /&gt;Component Component Name Changes&lt;br /&gt;&lt;br /&gt;&lt;p style="text-align: justify;"&gt;JTextField No Anggota — no&lt;/p&gt; &lt;p style="text-align: justify;"&gt;JTextField Nama — nama&lt;/p&gt; &lt;p style="text-align: justify;"&gt;JTextField Alamat — alamat&lt;/p&gt; &lt;p style="text-align: justify;"&gt;JComboBox Agama — agama&lt;/p&gt; &lt;p style="text-align: justify;"&gt;JRadioButton Jkel — RPria dan RWanita&lt;/p&gt; &lt;p style="text-align: justify;"&gt;JTextField No KTP — noktp&lt;/p&gt; &lt;p style="text-align: justify;"&gt;JTextField No. Telp — notelp&lt;/p&gt; &lt;p style="text-align: justify;"&gt;JTextField Simpanan — simpanan&lt;/p&gt; &lt;p style="text-align: justify;"&gt;JButton Simpan — bsimpan&lt;/p&gt; &lt;p style="text-align: justify;"&gt;JButton Data Baru — bbaru&lt;/p&gt; &lt;p style="text-align: justify;"&gt;JButton Keluar — bkeluar&lt;br /&gt;&lt;br /&gt;3. After you change the name of each component so it's time to process incoming Coding.&lt;br /&gt;&lt;br /&gt;Program Code:&lt;br /&gt;- Below the tab name of your project, click the source:&lt;br /&gt;Under the package type you import the following command to retrieve the sql commands.&lt;br /&gt;&lt;br /&gt;=======================================================&lt;br /&gt;&lt;br /&gt;import java.sql;&lt;br /&gt;&lt;br /&gt;=======================================================&lt;br /&gt;&lt;br /&gt;- The declaration of a variable connection, resultset, statement and the other variables that are required&lt;br /&gt;&lt;br /&gt;Public under the following class type variables;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="text-align: justify;"&gt;=======================================================&lt;br /&gt;//deklarasi variabel global&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Connection Con;&lt;br /&gt;ResultSet RsAng;&lt;br /&gt;Statement StatAng;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;//variabel for agama&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;String sagm = “1″;&lt;/span&gt;&lt;br /&gt;//variabel for jenis kelamin&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Boolean bjkel = true;&lt;/span&gt;&lt;br /&gt;//variabel global where data ditemukan&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Boolean ada = false;&lt;/span&gt;&lt;/p&gt; &lt;p style="text-align: justify;"&gt;- Then, under public nama_project (under the introduction of a variable) type the command database connection and table below:&lt;/p&gt; &lt;p style="text-align: justify;"&gt;//connection&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;String fdata = “z:\\java1\\NetBeans\\Koperasi.mdb”;&lt;br /&gt;Class.forName(”sun.jdbc.odbc.JdbcOdbcDriver”);&lt;/span&gt;&lt;/p&gt; &lt;p&gt;// direct connection to the database without dsn&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Con= DriverManager.getConnection(”jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=” + fdata);&lt;/span&gt;&lt;br /&gt;//shows the search process can be in the resultset update&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;StatAng= Con.createStatement( RsAng.TYPE_SCROLL_SENSITIVE, RsAng.CONCUR_UPDATABLE );&lt;br /&gt;RsAng = StatAng.executeQuery(”Select* from Anggota”);&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;catch(Exception e)&lt;br /&gt;{ &lt;span style="color: rgb(255, 0, 0);"&gt;System.err.println(”Conection error !” + e.getMessage());&lt;/span&gt; } //getMessage to display the message&lt;/p&gt; =======================================================&lt;p style="text-align: justify;"&gt;- After the connection is successful then the time we go to the key store. Type the following code:&lt;br /&gt;&lt;br /&gt;================================================== ====&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;private void bsimpanActionPerformed(java.awt.event.ActionEvent evt) {&lt;span&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;// TODO add your handling code here:&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;try&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;{&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;RsAng.updateString(”Noang”, no.getText());&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;RsAng.updateString(”Nama”, nama.getText());&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;RsAng.updateString(”Alamat”, alamat.getText());&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;RsAng.updateString(”Agama”, sagm);&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;RsAng.updateBoolean(”Jkel”, bjkel);&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;RsAng.updateString(”NoKTP”, noktp.getText());&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;RsAng.updateString(”NoTelp”, notelp.getText());&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;RsAng.updateDouble(”Simpanan”, Double.parseDouble(simpanan.getText()));&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;if(ada)&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;{&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;//mengedit data yang sudah ada&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;RsAng.updateRow();&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;javax.swing.JOptionPane.showMessageDialog(null, “Data Telah Diedit !”);&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;}&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;else&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;//menyisipkan record baru&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;RsAng.insertRow();&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;javax.swing.JOptionPane.showMessageDialog(null, “Data Telah Tersimpan !”);&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;catch(Exception e)&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;{&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;javax.swing.JOptionPane.showMessageDialog(null, “Data Belum Tersimpan !” + e.getMessage());&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;}&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;}&lt;span&gt; &lt;/span&gt;&lt;/p&gt; ======================================================&lt;br /&gt;&lt;br /&gt;- Code Programs for RadioButton Male:&lt;br /&gt;&lt;br /&gt;======================================================&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;private void RPriaActionPerformed(java.awt.event.ActionEvent evt) {&lt;span&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;// TODO add your handling code here:&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;bjkel = true;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="line-height: 115%;font-family:Calibri;" &gt;}&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt; ======================================================&lt;br /&gt;&lt;br /&gt;- Code Programs for Women's RadioButton:&lt;br /&gt;&lt;br /&gt;======================================================&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;private void RWanitaActionPerformed(java.awt.event.ActionEvent evt) {&lt;span&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;// TODO add your handling code here:&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;bjkel = false;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="line-height: 115%;font-family:Calibri;" &gt;} &lt;/span&gt;&lt;/p&gt; =====================================================&lt;br /&gt;&lt;br /&gt;- To type a ComboBox in the code the program:&lt;br /&gt;&lt;br /&gt;=====================================================&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;private void agamaActionPerformed(java.awt.event.ActionEvent evt) {&lt;span&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;// TODO add your handling code here:&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;// Baca Source objectnya masih JcomboBox&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;javax.swing.JComboBox soagama = (javax.swing.JComboBox)evt.getSource();&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;//Membaca Item Yang Terpilih — &gt; String&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;String sagama = (String)soagama.getSelectedItem();&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;//pengujian sagama&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;if (sagama.equals(”Islam”))&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;sagm = “1″;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;else if (sagama.equals(”Kristen”))&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;sagm = “2″;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;else if (sagama.equals(”Hindhu”))&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;sagm = “3″;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;else if (sagama.equals(”Budha”))&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;sagm = “4″;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;else if (sagama.equals(”Konghu Chu”))&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;sagm = “5″;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="line-height: 115%;font-family:Calibri;" &gt;}&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt; =====================================================&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;" id="result_box" dir="ltr"&gt;- Keys To New Data type program:&lt;br /&gt;&lt;br /&gt;=====================================================&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;private void bbaruActionPerformed(java.awt.event.ActionEvent evt) {&lt;span&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;// TODO add your handling code here:&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;no.setText(”");&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;nama.setText(”");&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;alamat.setText(”");&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;noktp.setText(”");&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;notelp.setText(”");&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;simpanan.setText(”");&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="line-height: 115%;font-family:Calibri;" &gt;}&lt;span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt; =====================================================&lt;br /&gt;&lt;br /&gt;- To Exit Button component type in the code the program:&lt;br /&gt;&lt;br /&gt;=====================================================&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;private void bkeluarActionPerformed(java.awt.event.ActionEvent evt) {&lt;span&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;// TODO add your handling code here:&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;//Tutup Koneksi&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;try&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;{&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Con.close();&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span lang="IT"&gt;RsAng.close();&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span lang="IT"&gt;StatAng.close();&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span lang="IT"&gt;Con = null; RsAng = null; StatAng = null;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;}&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;catch (Exception e){}&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;System.exit(0);&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="line-height: 115%;font-family:Calibri;" &gt;}&lt;/span&gt;&lt;/p&gt; ====================================================&lt;br /&gt;&lt;br /&gt;Additional notes (rusted Bos)&lt;br /&gt;&lt;br /&gt;- To fill the ComboBox religion you click on the ComboBox component on the properties and religious search model, then click the dialog box will appear as follows:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;" class="gallery"&gt;&lt;a href="http://haryansyah.ppkia.ac.id/wp-content/uploads/2008/06/combo.jpg"&gt;&lt;img title="combo" src="http://haryansyah.ppkia.ac.id/wp-content/uploads/2008/06/combo-300x286.jpg" height="286" width="300" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;- Add the components in the form buttongroup note discount image below:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;" class="gallery"&gt;&lt;a href="http://haryansyah.ppkia.ac.id/wp-content/uploads/2008/06/buttongroup.jpg"&gt;&lt;img title="buttongroup" src="http://haryansyah.ppkia.ac.id/wp-content/uploads/2008/06/buttongroup.jpg" height="216" width="213" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;Drag to your form. But you will not see But wujudnya.hehehehehe to change the name of the components please enter your navigator to the left side of your monitor. Change the name of its components with the name "bgjkel"&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;" class="gallery"&gt;&lt;a href="http://haryansyah.ppkia.ac.id/wp-content/uploads/2008/06/bgjkel.jpg"&gt;&lt;img title="bgjkel" src="http://haryansyah.ppkia.ac.id/wp-content/uploads/2008/06/bgjkel-270x300.jpg" height="300" width="270" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;- After entering ButtonGroup components and change the name then click on the component RPria and RWanita properties and then on the search button and change the group into bgjkel.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;" class="gallery"&gt;&lt;a href="http://haryansyah.ppkia.ac.id/wp-content/uploads/2008/06/bgjkel2.jpg"&gt;&lt;img title="bgjkel2" src="http://haryansyah.ppkia.ac.id/wp-content/uploads/2008/06/bgjkel2.jpg" height="268" width="235" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;Congratulations you try a new project in NetBeans IDE 6.5&lt;br /&gt;&lt;br /&gt;Author apologize because order is still not known to this article. Because I do not have spare time to improve the view. Thank you already want to visit.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7464055709054203132-2798523829762766940?l=project-java.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://project-java.blogspot.com/feeds/2798523829762766940/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://project-java.blogspot.com/2009/02/create-database-with-netbeans-program.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/2798523829762766940'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/2798523829762766940'/><link rel='alternate' type='text/html' href='http://project-java.blogspot.com/2009/02/create-database-with-netbeans-program.html' title='Create Database with Netbeans Program and Ms.Access'/><author><name>Son Rokhaniawan Perdata, S.T</name><uri>http://www.blogger.com/profile/17482607511048653600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_3PrCZQCxHao/SVJnUM5McbI/AAAAAAAAAHQ/4WvrWg1K28o/S220/son.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7464055709054203132.post-3804585780494261498</id><published>2009-02-11T11:10:00.005+07:00</published><updated>2009-02-11T11:27:18.185+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='Project'/><category scheme='http://www.blogger.com/atom/ns#' term='Netbeans'/><title type='text'>NetBeans IDE Java Quick Start Tutorial (Hello Word)</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.netbeans.org/images/articles/65/netbeans-stamp.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 114px; height: 114px;" src="http://www.netbeans.org/images/articles/65/netbeans-stamp.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Welcome to NetBeans IDE!&lt;/span&gt;         &lt;p&gt;This tutorial provides a very simple and quick introduction to the NetBeans IDE workflow by walking you through the creation of a simple "Hello World" Java console application. Once you are done with this tutorial, you will have a general knowledge of how to create and run applications in the IDE.&lt;/p&gt;         &lt;p&gt;This tutorial takes less than 10 minutes to complete.&lt;/p&gt;         &lt;p&gt;After you finish this tutorial, you can move on to the learning trails,             which are linked from the Documentation, Training &amp;amp; Support page. The learning trails provide comprehensive tutorials that highlight a wider range of IDE features and programming techniques for a variety of application types. If you do not want to do a "Hello World" application, you can skip this tutorial and jump straight to the learning trails. &lt;/p&gt;&lt;span id="fullpost"&gt;&lt;p&gt;&lt;b&gt;To complete this tutorial, you need the following software and resources.&lt;/b&gt;&lt;/p&gt;          &lt;table&gt;             &lt;tbody&gt;                 &lt;tr&gt;                     &lt;th class="tblheader" scope="col"&gt;Software or Resource&lt;/th&gt;                     &lt;th class="tblheader" scope="col"&gt;Version Required&lt;/th&gt;                 &lt;/tr&gt;                 &lt;tr&gt;                     &lt;td class="tbltd1"&gt;&lt;a href="http://www.netbeans.org/downloads/index.html"&gt;NetBeans IDE&lt;/a&gt;&lt;/td&gt;                     &lt;td class="tbltd1"&gt;version 6.5&lt;/td&gt;                 &lt;/tr&gt;                 &lt;tr&gt;                     &lt;td class="tbltd1"&gt;&lt;a href="http://java.sun.com/javase/downloads/index.jsp"&gt;Java Development Kit (JDK)&lt;/a&gt;&lt;/td&gt;                     &lt;td class="tbltd1"&gt;version 6 or&lt;br /&gt;                version 5&lt;/td&gt;                 &lt;/tr&gt;              &lt;/tbody&gt;         &lt;/table&gt;          &lt;h2&gt;Setting Up the Project&lt;a name="setup"&gt;&lt;/a&gt;&lt;/h2&gt;         &lt;p&gt;To create an IDE project:&lt;/p&gt;          &lt;ol&gt;&lt;li&gt;Start NetBeans IDE.&lt;/li&gt;&lt;li&gt;In the IDE, choose File &gt; New Project (Ctrl-Shift-N), as shown in the figure below.                 &lt;p&gt;&lt;img src="http://www.netbeans.org/images/articles/65/java/quickstart/new-proj.png" alt="" /&gt; New Project menu item selected." class="margin-around" height="85" width="199"&gt;&lt;/p&gt;             &lt;/li&gt;&lt;li&gt;In the New Project wizard, expand the Java category and select Java Application as shown in the figure below. Then click Next.                 &lt;img style="width: 492px; height: 404px;" src="http://www.netbeans.org/images/articles/65/java/quickstart/proj-wizard.png" alt="NetBeans IDE, New Project wizard, Choose Project page." class="margin-around" /&gt;             &lt;/li&gt;&lt;li&gt;In the Name and Location page of the wizard, do the following (as shown in the figure below):                  &lt;ul&gt;&lt;li&gt;In the Project Name field, type &lt;code&gt;HelloWorldApp&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;Leave the Use Dedicated Folder for Storing Libraries checkbox unselected.&lt;/li&gt;&lt;li&gt;In the Create Main Class field, type &lt;code&gt;helloworldapp.HelloWorldApp&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;Leave the Set as Main Project checkbox selected.&lt;/li&gt;&lt;/ul&gt;                 &lt;p class="align-center"&gt;&lt;img style="width: 488px; height: 454px;" src="http://www.netbeans.org/images/articles/65/java/quickstart/proj-wizard2.png" alt="NetBeans IDE, New Project wizard, Name and Location page." class="margin-around" /&gt;&lt;/p&gt;             &lt;/li&gt;&lt;li&gt;Click Finish.&lt;/li&gt;&lt;/ol&gt;         &lt;p&gt;The project is created and opened in the IDE. You should see the following components:         &lt;/p&gt;&lt;ul&gt;&lt;li&gt;The Projects window, which contains a tree view of the components of the project,                 including source files, libraries that your code depends on, and so on.             &lt;/li&gt;&lt;li&gt;The Source Editor window with a file called &lt;code&gt;HelloWorldApp&lt;/code&gt; open.             &lt;/li&gt;&lt;li&gt;The Navigator window, which you can use to quickly navigate between             elements within the selected class.&lt;/li&gt;&lt;li&gt;The Tasks window, which lists compilation errors as well other tasks             that are marked with keywords such as XXX and TODO.&lt;/li&gt;&lt;/ul&gt;         &lt;p class="align-center"&gt;&lt;img style="width: 523px; height: 587px;" src="http://www.netbeans.org/images/articles/65/java/quickstart/proj-opened.png" alt="NetBeans IDE with the HelloWorldApp project open." class="margin-around" /&gt;&lt;/p&gt;         &lt;a name="code"&gt;&lt;/a&gt;&lt;h2&gt;Adding Code to the Generated Source File&lt;/h2&gt;          &lt;p&gt;Because you have left the Create Main Class checkbox selected in the         New Project wizard, the IDE has created a skeleton class for you.         You can add the "Hello World!" message to the         skeleton code by replacing the line:          &lt;/p&gt;&lt;pre class="examplecode"&gt;            // TODO code application logic here&lt;br /&gt;   &lt;/pre&gt;          with the line:          &lt;pre class="examplecode"&gt;            System.out.println("Hello World!");&lt;br /&gt;   &lt;/pre&gt;          &lt;p&gt;Save the change by choosing File &gt; Save.&lt;/p&gt;          &lt;p&gt;The file should look something like the following code sample.&lt;/p&gt;         &lt;pre class="examplecode"&gt;/*&lt;br /&gt;* To change this template, choose Tools | Templates&lt;br /&gt;* and open the template in the editor.&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;package helloworldapp;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;*&lt;br /&gt;* @author Patrick Keegan&lt;br /&gt;*/&lt;br /&gt;public class HelloWorldApp {&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* @param args the command line arguments&lt;br /&gt;*/&lt;br /&gt;public static void main(String[] args) {&lt;br /&gt;       System.out.println("Hello World!");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;          &lt;a name="run"&gt;&lt;/a&gt;&lt;h2&gt;Compiling and Running the Program&lt;/h2&gt;         &lt;p&gt;Because of the IDE's Compile on Save feature, you do not have to manually compile             your project in order to run it in the IDE. When you save a Java source file, the IDE         automatically compiles it.&lt;/p&gt;          &lt;p&gt;&lt;b&gt;To run the program:&lt;/b&gt;&lt;/p&gt;         &lt;ul&gt;&lt;li&gt;Choose Run &gt; Run Main Project (F6).&lt;/li&gt;&lt;/ul&gt;          &lt;p&gt;The next figure shows what you should now see.&lt;/p&gt;         &lt;p class="align-center"&gt;&lt;img style="width: 528px; height: 166px;" src="http://www.netbeans.org/images/articles/65/java/quickstart/run-output.png" alt="The program prints Hello World! to the Output window (along with other output from the build script)." class="margin-around" align="bottom" /&gt;&lt;/p&gt;         &lt;p&gt;             Congratulations! Your program works!         &lt;/p&gt;          &lt;p&gt;If there are compilation errors, they are marked with red glyphs             in the left and right margins of the Source Editor. The glyphs in the left             margin indicate errors for the corresponding lines. The glyphs in the right             margin show all of the areas of the file that have errors, including errors             in lines that are not visible. You can mouse over an error mark to get a             description of the error. You can click a glyph in the right margin to jump             to the line with the error.     &lt;/p&gt;          &lt;a name="build"&gt;&lt;/a&gt;&lt;h2&gt;Building and Deploying the Application&lt;/h2&gt;          &lt;p&gt;Once you have written and test run your application, you can             use the Clean and Build command to build your application for deployment.             When you use the Clean and Build command, the          IDE runs a build script that performs the following tasks:&lt;/p&gt;         &lt;ul&gt;&lt;li&gt;Deletes any previously compiled files and             other build outputs.&lt;/li&gt;&lt;li&gt;Recompiles the application and builds a JAR file             containing the compiled files.&lt;/li&gt;&lt;/ul&gt;         &lt;p&gt;&lt;b&gt;To build your application:&lt;/b&gt;&lt;/p&gt;         &lt;ul&gt;&lt;li&gt;Choose Run &gt; Clean and Build Main Project (Shift-F11).&lt;/li&gt;&lt;/ul&gt;          &lt;p&gt;You can view the build outputs by opening the Files window and expanding             the HelloWorldApp node.             The compiled bytecode file &lt;code&gt;HelloWorldApp.class&lt;/code&gt;             is within the &lt;code&gt;build/classes/helloworldapp&lt;/code&gt; subnode.             A deployable JAR file that contains the         &lt;code&gt;HelloWorldApp.class&lt;/code&gt; is within the &lt;code&gt;dist&lt;/code&gt; node.&lt;/p&gt;     &lt;img src="http://www.netbeans.org/images/articles/65/java/quickstart/files-window.png" alt="Image showing the Files window with the nodes for the HelloWorldApp          expanded to show the contents of the build and dist subnodes." class="margin-around" height="332" width="228" /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7464055709054203132-3804585780494261498?l=project-java.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://project-java.blogspot.com/feeds/3804585780494261498/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://project-java.blogspot.com/2009/02/netbeans-ide-java-quick-start-tutorial.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/3804585780494261498'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/3804585780494261498'/><link rel='alternate' type='text/html' href='http://project-java.blogspot.com/2009/02/netbeans-ide-java-quick-start-tutorial.html' title='NetBeans IDE Java Quick Start Tutorial (Hello Word)'/><author><name>Son Rokhaniawan Perdata, S.T</name><uri>http://www.blogger.com/profile/17482607511048653600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_3PrCZQCxHao/SVJnUM5McbI/AAAAAAAAAHQ/4WvrWg1K28o/S220/son.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7464055709054203132.post-1988241948196660645</id><published>2009-02-11T10:58:00.002+07:00</published><updated>2009-02-11T11:04:13.925+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Guide'/><category scheme='http://www.blogger.com/atom/ns#' term='Netbeans'/><title type='text'>NetBeans IDE Installation Guide</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Windows&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;On Microsoft Windows platforms, you can pick from one of the following downloads:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;   Self-extracting installer&lt;/li&gt;&lt;li&gt;   Archive distribution&lt;/li&gt;&lt;/ul&gt;   Using the Windows Installer&lt;br /&gt;&lt;br /&gt;  Once you have downloaded the installer file, double-click the file to start the installation wizard. The installer enables you to specify:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;       the Java™ 2 Software Development Kit to run the IDE on.&lt;/li&gt;&lt;li&gt;       which directory to install NetBeans IDE into.&lt;/li&gt;&lt;li&gt;       whether to associate .java and .nbm (NetBeans module files) with the IDE.&lt;/li&gt;&lt;/ul&gt;   To launch NetBeans IDE, do one of the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Double-click the NetBeans IDE icon on your desktop.&lt;/li&gt;&lt;li&gt;       Select NetBeans IDE | NetBeans IDE 3.6 | NetBeans IDE from the Start menu.&lt;/li&gt;&lt;/ul&gt;   Using Archive Installations on Windows Machines&lt;br /&gt;&lt;br /&gt;  While the installer described above is the preferred method of installation on Microsoft Windows machines, you can also install NetBeans IDE using a tar.gz or zip file. Common archive utilities like Winzip can work with both of these file types.&lt;br /&gt;&lt;br /&gt;  To install NetBeans IDE:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;      Locate the archive that you have downloaded and double-click it to open your archive file tool.&lt;/li&gt;&lt;li&gt;      Using your archive tool, extract all files to an empty directory, such as C:\NetBeans IDE 3.6.&lt;/li&gt;&lt;/ol&gt;   To launch NetBeans IDE:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;      Navigate to the bin subdirectory of your NetBeans IDE installation.&lt;/li&gt;&lt;li&gt;      Double-click runide.exe to start NetBeans IDE.&lt;/li&gt;&lt;/ol&gt;&lt;span id="fullpost"&gt;&lt;span style="font-weight: bold;"&gt;Solaris™ Operating System (Solaris OS) and Linux Platforms&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;On the Solaris and Linux platforms, you can pick from one of the following downloads:&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span id="fullpost"&gt;   Binary installer&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span id="fullpost"&gt;   Archive distribution&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span id="fullpost"&gt;   Using the Solaris and Linux Installers&lt;br /&gt;&lt;br /&gt;  To install NetBeans IDE:&lt;br /&gt;&lt;/span&gt;&lt;ol&gt;&lt;li&gt;&lt;span id="fullpost"&gt;      From a command prompt, navigate to the directory that contains the installer.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span id="fullpost"&gt;If necessary, change the permissions to make the binary executable by typing &lt;/span&gt;$ chmod +x NetBeans.bin (replacing NetBeans.bin with the actual filename of the distribution that you downloaded).&lt;/li&gt;&lt;li&gt;Start the installer by typing $ ./NetBeans.bin (replacing NetBeans.bin with the actual filename of the distribution that you downloaded).&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span id="fullpost"&gt;   The installer will search for any installed J2SDKs and prompt you for which NetBeans IDE should use. You can specify a J2SDK at the command line, which might speed the installation process. For example:&lt;br /&gt;&lt;br /&gt;      $ ./NetBeans.bin -is:javahome path_to_your_jdk&lt;br /&gt;&lt;br /&gt;  Using Archive Installations on UNIX® platforms&lt;br /&gt;&lt;br /&gt;  To install NetBeans IDE:, use the appropriate tools on your platform to untar or unzip the archive distribution to a clean directory. For example, type the following from a command prompt:&lt;br /&gt;&lt;br /&gt;      $ gzip -d NetBeans.tar.gz&lt;br /&gt;      $ tar xf NetBeans.tar&lt;br /&gt;&lt;br /&gt;  (replacing NetBeans.tar.gz and NetBeans.tar with the actual file names).&lt;br /&gt;&lt;br /&gt;  Note: Solaris users should use GNU tar for tar.gz files to ensure that the whole archive is unpacked.&lt;br /&gt;&lt;br /&gt;  To launch NetBeans IDE, change directories to the bin subdirectory of your installation and execute the runide.sh launcher script.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Macintosh OS X&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;On the Macintosh OS X platform, you can pick from one of the following downloads:&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span id="fullpost"&gt;   Disk image format (.dmg) file&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span id="fullpost"&gt;   Archive distribution&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span id="fullpost"&gt;Note: Mac OS users should use the .dmg file, which has a patch to fix the problem that is cited in issue 39780. If you install an archive distribution of the IDE on Mac OS, you could have problems properly shutting down the IDE.&lt;br /&gt;&lt;br /&gt;  Using the disk image format (.dmg) file&lt;br /&gt;&lt;br /&gt;  Once you have downloaded the image file, double-click the file to mount the file in your system.&lt;br /&gt;&lt;br /&gt;  To launch NetBeans IDE, run the NetBeansLauncher application.&lt;br /&gt;&lt;br /&gt;  Using Archive Installations on the Mac OS platform&lt;br /&gt;&lt;br /&gt;  To install NetBeans IDE:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span id="fullpost"&gt;Open the Terminal application and change directories to where you would like to install the IDE. On the command line type:&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span id="fullpost"&gt;&lt;br /&gt;            gnutar -xvzf netbeans.tar.gz&lt;br /&gt;&lt;br /&gt;        (replacing NetBeans.tar.gz with the actual filename of the distribution that you downloaded).&lt;br /&gt;&lt;br /&gt;  To launch NetBeans IDE, change directories to the bin subdirectory of your installation and execute the runide.sh launcher script.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Other Operating Systems&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  Using Archive Installations&lt;br /&gt;  Unpack your archive using the utilities appropriate for your system.&lt;br /&gt;&lt;br /&gt;  To launch NetBeans IDE, navigate to the bin subdirectory of your NetBeans IDE installation and execute the launcher that is appropriate for your system. The following launchers are available:&lt;br /&gt;&lt;br /&gt;      runide.exe - Windows&lt;br /&gt;      runidew.exe - Windows (no console window)&lt;br /&gt;      runide.sh - UNIX&lt;br /&gt;      runideos2.cmd - OS/2&lt;br /&gt;      runideopenvms.com - OpenVMS&lt;br /&gt;&lt;br /&gt;  If there is no launcher for your specific operating system, you might need to try to create one by modifying whatever script is most appropriate. If your machine supports JDK 1.4 or greater, you should be able to run the IDE.&lt;br /&gt;&lt;br /&gt;  Note: If you create a launcher, you could contribute it to the project.&lt;br /&gt;&lt;br /&gt;Installing on beta versions of Java™ 2 Software Development Kit (J2SDK), v. 1.5&lt;br /&gt;&lt;br /&gt;  You can run the IDE on betas of J2SDK v. 1.5, but the installer will not run if that is the only J2SDK that you have on your system. You must also have J2SDK v. 1.4.1 or compatible installed to run the installer. Once the installer is running, you can specify that the IDE should run on J2SDK v. 1.5 beta.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7464055709054203132-1988241948196660645?l=project-java.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://project-java.blogspot.com/feeds/1988241948196660645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://project-java.blogspot.com/2009/02/netbeans-ide-installation-guide.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/1988241948196660645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/1988241948196660645'/><link rel='alternate' type='text/html' href='http://project-java.blogspot.com/2009/02/netbeans-ide-installation-guide.html' title='NetBeans IDE Installation Guide'/><author><name>Son Rokhaniawan Perdata, S.T</name><uri>http://www.blogger.com/profile/17482607511048653600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_3PrCZQCxHao/SVJnUM5McbI/AAAAAAAAAHQ/4WvrWg1K28o/S220/son.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7464055709054203132.post-3422828775365220688</id><published>2009-02-10T12:07:00.004+07:00</published><updated>2009-02-10T19:02:19.388+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Guide'/><category scheme='http://www.blogger.com/atom/ns#' term='Netbeans'/><title type='text'>NetBeans!</title><content type='html'>&lt;span style="font-weight: bold;"&gt;1. What is NetBeans?&lt;/span&gt;&lt;br /&gt;NetBeans is an open-source Integrated Development Environment (IDE) you can download and use for free. NetBeans is also an extensible platform which you can use to build OS-independent applications. Finally, NetBeans is a thriving open-source community with hundreds of thousands of experienced developers located all around the world. More information.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.netbeans.org/images/v6/features/editor-java.png"&gt;&lt;img style="width: 519px; height: 284px;" alt="NetBeans Editor" src="http://www.netbeans.org/images/v6/features/editor-java-cut.png" border="none" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;2. How Do I Get Started?&lt;/span&gt;&lt;br /&gt;Download the NetBeans IDE. It has everything you need develop world-class applications. NetBeans software is a 100% Java-based IDE and platform, so it works on every OS where the JDK is available. NetBeans supports a wide range of Java technologies, but is not limited to Java - other languages are supported as well. The NetBeans tools have so much functionality, you can choose which download is best for you. Learn more about supported technologies and features on the features page. You can add more functionality with plug-in modules (in the IDE, choose Tools &gt; Plugins).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3. Where Can I Get Involved?&lt;/span&gt;&lt;br /&gt;There is a thriving worldwide community of NetBeans users out there, ranging from new users to gurus. Join them to discuss tips and tricks, NetBeans features, problem solving and much more. Sign up now!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;4. How Do I Learn More?&lt;/span&gt;&lt;br /&gt;There is a wealth of knowledge here on netbeans.org to get your teeth into, with new content being posted weekly. Tutorials, articles, guides, demos and screencasts.&lt;br /&gt;&lt;br /&gt;Welcome! We hope your visit is pleasant.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7464055709054203132-3422828775365220688?l=project-java.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://project-java.blogspot.com/feeds/3422828775365220688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://project-java.blogspot.com/2009/02/netbeans.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/3422828775365220688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/3422828775365220688'/><link rel='alternate' type='text/html' href='http://project-java.blogspot.com/2009/02/netbeans.html' title='NetBeans!'/><author><name>Son Rokhaniawan Perdata, S.T</name><uri>http://www.blogger.com/profile/17482607511048653600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_3PrCZQCxHao/SVJnUM5McbI/AAAAAAAAAHQ/4WvrWg1K28o/S220/son.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7464055709054203132.post-7509979032451693861</id><published>2009-02-10T12:00:00.003+07:00</published><updated>2009-02-10T19:03:27.920+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Guide'/><title type='text'>About the Java Technology</title><content type='html'>Java technology is both a programming language and a platform.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The Java Programming Language&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Java programming language is a high-level language that can be characterized by all of the following buzzwords:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Simple&lt;/li&gt;&lt;li&gt;Architecture neutral&lt;/li&gt;&lt;li&gt;Object oriented&lt;/li&gt;&lt;li&gt;Portable&lt;/li&gt;&lt;li&gt;Distributed&lt;/li&gt;&lt;li&gt;High performance&lt;/li&gt;&lt;li&gt;Multithreaded&lt;/li&gt;&lt;li&gt;Robust&lt;/li&gt;&lt;li&gt;Dynamic&lt;/li&gt;&lt;li&gt;Secure&lt;/li&gt;&lt;/ul&gt;    Each of the preceding buzzwords is explained in The Java Language Environment , a white paper written by James Gosling and Henry McGilton.&lt;br /&gt;&lt;br /&gt; In the Java programming language, all source code is first written in plain text files ending with the .java extension. Those source files are then compiled into .class files by the javac compiler. A .class file does not contain code that is native to your processor; it instead contains bytecodes — the machine language of the Java Virtual Machine1 (Java VM). The java launcher tool then runs your application with an instance of the Java Virtual Machine.&lt;br /&gt;&lt;br /&gt; Figure showing MyProgram.java, compiler, MyProgram.class, Java VM, and My Program running on a computer.&lt;br /&gt;&lt;br /&gt;&lt;p style="text-align: center;"&gt;&lt;img src="http://java.sun.com/docs/books/tutorial/figures/getStarted/g1.gif" alt="Figure showing MyProgram.java, compiler, MyProgram.class, Java VM, and My Program running on a computer." align="bottom" height="83" width="482" /&gt;&lt;/p&gt;&lt;br /&gt;&lt;span id="fullpost"&gt;&lt;span style="font-style: italic;"&gt;An overview of the software development process.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; Because the Java VM is available on many different operating systems, the same .class files are capable of running on Microsoft Windows, the Solaris TM Operating System (Solaris OS), Linux, or Mac OS. Some virtual machines, such as the Java HotSpot virtual machine, perform additional steps at runtime to give your application a performance boost. This include various tasks such as finding performance bottlenecks and recompiling (to native code) frequently used sections of code.&lt;br /&gt;&lt;br /&gt; Figure showing source code, compiler, and Java VM's for Win32, Solaris OS/Linux, and Mac OS&lt;br /&gt;&lt;br /&gt; Through the Java VM, the same application is capable of running on multiple platforms.&lt;br /&gt;&lt;br /&gt;&lt;p style="text-align: center;"&gt;&lt;img src="http://java.sun.com/docs/books/tutorial/figures/getStarted/helloWorld.gif" alt="Figure showing source code, compiler, and Java VM's for Win32, Solaris OS/Linux, and Mac OS" align="bottom" height="332" width="346" /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The Java Platform&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; A platform is the hardware or software environment in which a program runs. We've already mentioned some of the most popular platforms like Microsoft Windows, Linux, Solaris OS, and Mac OS. Most platforms can be described as a combination of the operating system and underlying hardware. The Java platform differs from most other platforms in that it's a software-only platform that runs on top of other hardware-based platforms.&lt;br /&gt;&lt;br /&gt; The Java platform has two components:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The Java Virtual Machine&lt;/li&gt;&lt;li&gt;The Java Application Programming Interface (API) &lt;/li&gt;&lt;/ul&gt;    You've already been introduced to the Java Virtual Machine; it's the base for the Java platform and is ported onto various hardware-based platforms.&lt;br /&gt;&lt;br /&gt; The API is a large collection of ready-made software components that provide many useful capabilities. It is grouped into libraries of related classes and interfaces; these libraries are known as packages. The next section, What Can Java Technology Do? highlights some of the functionality provided by the API.&lt;br /&gt;&lt;br /&gt; Figure showing MyProgram.java, API, Java Virtual Machine, and Hardware-Based Platform&lt;br /&gt;&lt;br /&gt;&lt;p style="text-align: center;"&gt;&lt;img src="http://java.sun.com/docs/books/tutorial/figures/getStarted/g3.gif" alt="Figure showing MyProgram.java, API, Java Virtual Machine, and Hardware-Based Platform" align="bottom" height="102" width="221" /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt; The API and Java Virtual Machine insulate the program from the underlying hardware.&lt;br /&gt; As a platform-independent environment, the Java platform can be a bit slower than native code. However, advances in compiler and virtual machine technologies are bringing performance close to that of native code without threatening portability.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; The terms"Java Virtual Machine" and "JVM" mean a Virtual Machine for the Java platform. &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7464055709054203132-7509979032451693861?l=project-java.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://project-java.blogspot.com/feeds/7509979032451693861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://project-java.blogspot.com/2009/02/about-java-technology.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/7509979032451693861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7464055709054203132/posts/default/7509979032451693861'/><link rel='alternate' type='text/html' href='http://project-java.blogspot.com/2009/02/about-java-technology.html' title='About the Java Technology'/><author><name>Son Rokhaniawan Perdata, S.T</name><uri>http://www.blogger.com/profile/17482607511048653600</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_3PrCZQCxHao/SVJnUM5McbI/AAAAAAAAAHQ/4WvrWg1K28o/S220/son.jpg'/></author><thr:total>0</thr:total></entry></feed>
