- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Samual Sam has Published 2492 Articles
Samual Sam
577 Views
Following example demonstrates how to check whether the date is in a proper format or not using matches method of String class.ExampleLive Demopublic class Main { public static void main(String[] argv) { boolean isDate = false; String date1 = "8-05-1988"; ... Read More
Samual Sam
141 Views
GregorianCalendar is a concrete implementation of a Calendar class that implements the normal Gregorian calendar with which you are familiar. We did not discuss Calendar class in this tutorial, you can look up standard Java documentation for this.The getInstance( ) method of Calendar returns a GregorianCalendar initialized with the current date and ... Read More
Samual Sam
2K+ Views
Deadlock describes a situation where two or more threads are blocked forever, waiting for each other. Deadlock occurs when multiple threads need the same locks but obtain them in a different order. A Java multithreaded program may suffer from the deadlock condition because the synchronized keyword causes the executing thread to block ... Read More
Samual Sam
5K+ Views
Date and time formatting can be done very easily using the printf method. You use a two-letter format, starting with t and ending in one of the letters of the table as shown in the following code.ExampleLive Demoimport java.util.Date; public class DateDemo { public static void main(String args[]) ... Read More
Samual Sam
6K+ Views
If the remainder of the number when it is divided by 2 is 0, then it would be divisible by 2.Let’s say our number is 5, we will check it using the following if-else −// checking if the number is divisible by 2 or not if (num % 2 == ... Read More
Samual Sam
5K+ Views
Common Language Runtime (CLR) manages the execution of .NET programs. The just-in-time compiler converts the compiled code into machine instructions. This is what the computer executes.The services provided by CLR include memory management, exception handling, type safety, etc.Let us see the features of Common Language Runtime (CLR) in C#:ComponentsComponents in ... Read More
Samual Sam
253 Views
With JDK 7, we can create a translucent window using swing very easily. With following code, a JFrame can be made translucent.// Set the window to 55% opaque (45% translucent). frame.setOpacity(0.55f);ExampleSee the example below of a window with 55% translucency.import java.awt.GridBagLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.SwingUtilities; public class ... Read More
Samual Sam
675 Views
You can sleep for any period of time from one millisecond up to the lifetime of your computer. For example, the following program would sleep for 3 seconds −Example Live Demoimport java.util.*; public class SleepDemo { public static void main(String args[]) { try { ... Read More
Samual Sam
698 Views
With JDK 7, we can create a shaped window using swing very easily. Following are the steps needed to make a shaped window. Add a component listener to frame and override the componentResized() to change the shape of the frame. This method recalculates the shape of the frame correctly whenever the ... Read More
Samual Sam
65 Views
Multicolumn UNIQUE indexes can also be removed in the same as we remove UNIQUE constraint from the table.ExampleIn this example, with the following query we have removed the multicolumn UNIQUE indexes on table ‘employee’ −mysql> DROP index id_fname_lname on employee; Query OK, 0 rows affected (0.30 sec) Records: 0 Duplicates: ... Read More