Free Online Whiteboard Base64 Converter JSON Utility SmartTool PDF

Category: Core Java

What is the serialization? 0

What is the serialization?

In computer science, in the context of data storage, serialization is the process of translating data structures or object state into a format that can be stored or transmitted and reconstructed later. The Serializable...

How to make a class or a bean serializable? 0

How to make a class or a bean serializable?

In computer science, in the context of data storage, serialization is the process of translating data structures or object state into a format that can be stored or transmitted and reconstructed later. The Serializable...

Schedule a task and generate beep 0

Schedule a task and generate beep

Example that uses java.util.Timer to schedule a task to execute once 3 seconds have passed. ScheduleAndBeep.java import java.util.Timer; import java.util.TimerTask; import java.awt.Toolkit; public class ScheduleAndBeep { Toolkit toolkit; Timer timer; public ReminderBeep(int seconds) {...

DeadLock Example in Java 0

DeadLock Example in Java

FirstThread.java public class FirstThread { public synchronized void startProcess(SecondThread sec) throws Exception { String name = Thread.currentThread().getName(); System.out.println(name + ” Entered FirstThread.startProcess”); Thread.sleep(1000); System.out.println(“Trying to call SecondThread.last”); sec.last(); } public synchronized void last() throws...

When is abstract class used? 0

When is abstract class used?

abstract keyword is used to create a abstract class and method. Abstract class in java can’t be instantiated. An abstract class is mostly used to provide a base for subclasses to extend and implement...

When is an interface used? 0

When is an interface used?

A class that implement interface must implement all the methods declared in the interface. To implement interface use implements keyword. Since java does not support multiple inheritance in case of class, but by using...