Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: Creating and using an anonymous class

public class Person
 {
     // anonymous class
    interface Action
    	 {
          void manger();
         }
  public static void main(String[] ar

Java: no argument constructor

public class NoArgumentConstructor
 {
  public static void main(String[] args)
   {
         new MyTV ();
   }
 }
 class MyTV
 	{
    // create no-ar

Java: How to clone objects

public class Persons implements Cloneable
 {
  private String name;
  private double salary;
  public Object clone()
  	{
    Persons obj = new Perso

Java: Using Constructors that Have Arguments

public class ConstructorWithArg
 {
  public static void main(String[] args)
   {
         new TV ("Toshiba","800.000$");
   }
 }
 class TV
 	{
    //

Java: How to use the protected keyword

public class Person
 {
  private String name;
  private double salary;
  public Person(String nm, double sal)
   {
      name=nm;
      salary=sal;

Java: How to access inner class from outside

public class ClasseMyInnerMyOuter
{
    public static void main(String[] args)
    {
        MyOuter inner_obj = new MyOuter();
        // access inn

Java: How to clone Arrays

public class CloneArrays
{
  public static void main(String[] argv) throws Exception
  	{
  		// int array
    int[] myTab = new int[] { 1, 2, 3, 9,

Java: How to clone Collections

import java.util.ArrayList;
import java.util.Iterator;
public class CloneCollection
{
  public static void main(String[] args)
  	{
    ArrayList list

Java: Anonymous inner class

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOp

Java: How to call a static method of an abstract class

abstract class AbstractStaticMethode
{
  public static void salut()
  {
    System.out.println("Welcom to java.tubedir.com");
  }
  public static voi