Quantcast
Channel: Techankit » programs
Browsing all 7 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Program to demonstrate the use of package in Java

import p.Add; class UsePack { public static void main(String args[]) { Add a=new Add(); a.add(10,3); System.out.println(“Graphic Era”); } }   Package class   package p; public class Add { int sum=0;...

View Article



Image may be NSFW.
Clik here to view.

Example of object serialization in Java

import java.io.*; class OSerial { public static void main(String args[]) throws Exception { A x=new A(13); x.show(); ObjectOutputStream OOS=new ObjectOutputStream(new FileOutputStream(new...

View Article

Image may be NSFW.
Clik here to view.

Example of Thread synchronization in Java

import java.io.*; class ThSyn { public static void main(String args[]) throws Exception { PrintIt P=new PrintIt(); ThreadA a=new ThreadA(); ThreadB b=new ThreadB(); a.create(P); b.create(P); a.start();...

View Article

Image may be NSFW.
Clik here to view.

Program to demonstrate the use of radio buttons in Java

import java.awt.*; import java.awt.event.*; import java.applet.*; import javax.swing.*;   public class Face extends Applet implements ActionListener { int chk=0,f1,f2,f3; Label L1,L2,L3; JRadioButton...

View Article

Image may be NSFW.
Clik here to view.

Calculator program in Java using gridlayout

/*import packages*/ import java.applet.*; import java.awt.event.*; import java.awt.*; import javax.swing.*; /*start of class*/ public class Cal extends JApplet implements ActionListener { /*declaration...

View Article


Image may be NSFW.
Clik here to view.

Program to demonstrate the use of BorderLayout in Java

import java.applet.*; import java.awt.*; import java.awt.event.*; public class BL extends Applet implements ActionListener,Runnable { int up=0,right=0,left=0,down=0; String msg=”"; Button...

View Article

Image may be NSFW.
Clik here to view.

How System.out.println works in Java

System is a final class, hence cannot be inherit. out is a variable of PrintStream class, which is defined in io package and created in System class. println is a method defined in PrintStream class....

View Article
Browsing all 7 articles
Browse latest View live




Latest Images