Source Code news

Find Source code for your requirement here.

Java Threads Wait Notify Example Program

(adsbygoogle = window.adsbygoogle || []).push({}); Java Wait and Notify Threads Program class Que1 { int n; boolean flag = false; synchronized int get() { if(!flag) try{ wait(); }catch (InterruptedException e) { System.out.println(“Exception”); } Sy Read More..

Java Threads Without Locks Example Program

class TwoStrings { static void print (String str1, String str2) { System.out.print(str1); try { Thread.sleep(500); } catch (InterruptedException ie) { e.printStackTrace(); } System.out.println(str2); } } class PrintStringsThread implements Runnable { String str1, str2; PrintStrin Read More..

Threads Synchronization in Java with Example

You can find here Threads Synchronization example program.This threads synchronization is based on lock Synchronize concept. class TwoStrings1 { synchronized static void print (String str1, String str2){ System.out.print(str1); try{ Thread.sleep(1000); } catch (InterruptedExcepti Read More..

Threads Methods in Java with Example

In this page you will get threads methods in Java with example source code. You can find infomration about Java Threads methods with example program. class Methods implements Runnable{ Thread t; String name; public Methods(String n){ name = n; System.out.println(name +” Th Read More..

Implements Runnable Example Program in Java

You can get Java code for Java Implements Runnable in thread concept with example program. class PrintRunnable implements Runnable { public PrintRunnable(){ System.out.println(“New Thread started”); new Thread(this).start(); } public void run() { for (int i = 0; i &lt Read More..

Java Threads Implements Runnable Example Program

You can get Java code for Threads class implements runnable program. You can get the example program for Java Threads Implements Runnable. class PrintNameRunnable implements Runnable { public PrintNameRunnable(){ System.out.println(“New Thread started”); } public void Read More..

Java Thread Sample Program by using Extend Thread

You can get Java code for sample thread program by using the extend thread concept in Java. class PrintThread extends Thread{ String name; public PrintThread(String msg){; name = msg; System.out.println(“Thread: “+ name); start(); } public void run(){ for (int i = 0; Read More..

Java Extend Thread Example Program

You can find here Extend Threads concept by extend the thread class.The sample program code for extend thread basic concept in Java Thread. public class ExtendThread1 extends Thread{ public ExtendThread2(){ System.out.println(“New Thread is started”); } public void ru Read More..

Exception Handling in Java Example Program

You can find Exception Handling in Java Examples . In this page you can learn basic concept of Exception Handling Example Program. class BasicException{ public static void main(String args[]){ int d,a; try{ d=0; a=42/d; System.out.println(“This will not be printed.”); Read More..

Super Keyword in Java with example

Super Keyword in Java with example. You can find Super keyword example Program (code snippets) in this page. class Base1{ protected int num; public Base1(int n){ num = n; System.out.println(“\n\t1-parameter constructor of Base class.”); } public void display(){ System Read More..

Multiple Inheritance Example Program in Java

Multiple Inheritance Example Program in Java. You can find multiple inheritance example program (code snippets) in this page. interface First{ void disp(); } interface Second extends First{ void show(); } abstract class Shape1{ abstract void draw(); } class Rectangle1 extends Sha Read More..

Inheritance Example Program in Java

Inheritance Example Program in Java. You can find inheritance example program (code snippets) in this page. class Base{ private int num; public Base(){ num = 100; System.out.println(“\n\tDefault constructor of Base class.”); } public void displayNum(){ System.out.prin Read More..

Dynamic Binding Example in Java

Dynamic Binding Example in Java. You can find dynamic binding Concept with Example Program (code snippets) in this page. class Shape{ public void draw()         { System.out.println(“\n\tDrawing a shape.”); } } class Circle extends Shape{ public void draw()  Read More..

Abstract Class Example in Java Program

Abstract Class Example in Java Program. You can find Abstract Class, Abstract method, Abstract Concept program (code snippets) in this page. abstract class Shape{ abstract void draw(); } class Rectangle extends Shape{ void draw(){ System.out.println(“Drawing Rectangle&#8221 Read More..

Static Method in Java Example Program

Static Method in Java Example Program. You can find Static member method in Java with Example Program (code snippets) in this page. class StaticMemberMethod{ private static int count; private static int data; static{ count = 0; } public StaticMemberMethod(){ count++; } public sta Read More..