Ruang penulis
SEBUAH JURNAL TENTANG TEKNOLOGI

Belajar hal baru.
Tulis. Bagikan.

Ruang untuk merangkai pengetahuan, satu baris kode setiap hari.
Temukan tutorial, ide, dan catatan dari perjalanan belajar.

1914 catatan & terus bertumbuh
PILIHAN EDITOR
Java

Memahami Java Stream: olah koleksi dengan lebih ringkas

Pelajari alur filter, map, dan collect untuk mengolah data Java dengan kode yang mudah dibaca.

D Tim Diary Coding · 1 menit baca
UNTUK RASA INGIN TAHUMU

Catatan terbaru.

CORE API / CATATAN</>
Core API25 Apr 2007

How do I create a queue using LinkedList class?

package org.kodejava.util; import java.util.LinkedList; import java.util.Queue; public class QueueDemo { public static void main(String[] args) { // Create an instance of a queue, ere we use the LinkedList class which // implements the Queue interface. Add some elements to the queue using // the offer method. Queue<String> queue = new LinkedList<>(); queue.offer("First visitor"); queue.offer("Second visitor"); […]

Wayan · 2 menit baca
SWING / CATATAN</>
Swing21 Apr 2007

How do I handle a window closing event in Swing?

Here you will see how to handle the window closing event of a JFrame. What you need to do is to implement a java.awt.event.WindowListener interface and call the frame addWindowListener() method to add the listener to the frame instance. To handle the closing event implements the windowClosing() method of the interface. Instead of implementing the […]

Wayan · 2 menit baca
SWING / CATATAN</>
Swing21 Apr 2007

How do I close a JFrame application?

Closing a JFrame application can be done by setting the default close operation of the frame. There are some defined constants for the default operation. These constants defined in the javax.swing.WindowConstants interface include EXIT_ON_CLOSE, HIDE_ON_CLOSE, DO_NOTHING_ON_CLOSE and DISPOSE_ON_CLOSE. To exit an application we can set the default close operation to EXIT_ON_CLOSE, this option will call […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API16 Apr 2007

How do I create a method that accept varargs in Java?

Varargs (variable arguments) is a new feature in Java 1.5 which allows us to pass multiple values in a single variable name when calling a method. Of course, it can be done easily using array but the varargs add another power to the language. The varargs can be created by using three periods (…) after […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API15 Apr 2007

How do I use the Stack class in Java?

Stack is an extension of the java.util.Vector class that provided a LIFO (last-in-first-out) data structure. This class provide the usual method such as push() and pop(). The peek method is used the get the top element of the stack without removing the item. package org.kodejava.util; import java.util.Stack; public class StackExample { public static void main(String[] […]

Wayan · 2 menit baca
SERVLET / CATATAN</>
Servlet13 Apr 2007

How do I set the maximum age of a cookie?

package org.kodejava.servlet; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet(name = "CookieExpirationServlet", urlPatterns = "/cookie-expiration") public class CookieExpirationServlet extends HttpServlet { @Override protected void doGet(H...

Wayan · 1 menit baca

Pengetahuan tumbuh ketika dibagikan.

Simpan rasa ingin tahu. Selalu ada hal baru untuk dipelajari.

Jelajahi catatan ↗
Putu Adi Guna Permana
TENTANG PENULIS

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Penulis dan pendiri Diary Coding — berbagi catatan, tutorial, dan pengalaman seputar pemrograman untuk siapa pun yang ingin terus belajar.