Wednesday, April 4, 2012

Java networking

Java networking code for netbeans

http://www.mediafire.com/?dqpcxi6r100gir6

First run Host.java
then run Guest.java

Automatic and manual input method will be shown in class

Wednesday, March 28, 2012

Java Database Connection

Please find the following link of netbeans project for java database connection

http://www.4shared.com/rar/s5CvipIE/CSE412Lab8.html

or

http://www.mediafire.com/?a4sjp2paayk2bax


Please note that u have to create a database first using xampp with the name "cse412lab"
Then import the cse412lab.sql (available in the rar file) file while you are inside the database "cse412lab"

Now if you run the program using netbeans your program is likely to run without any error.

This procedure will be shown in the class so presence in the class is must.

Wednesday, March 14, 2012

Wednesday, March 7, 2012

Basic GUI Java

Netbeans project code

http://www.mediafire.com/?uzg36zadm316ef2

Download Jdk and jre

http://www.oracle.com/technetwork/java/javase/downloads/index.html

Download Netbeans

http://netbeans.org/downloads/

Wednesday, February 29, 2012

Interface , Try Catch, Multithreading


Code link of Netbeans project


http://tinyurl.com/cse412lab5


http://bit.ly/yWEE9G


This link contain the example of Interface , Try Catch, Multithreading

Visit the following site to ask any question about coding
http://stackoverflow.com/

Wednesday, February 22, 2012

Polymorphism Abstract Vector

Code link of Netbeans project 

tinyurl.com/cse412lab4

This link contain the example of Polymorphism, Abstract and Vector

Project


Your Project should have following component

1. Polymorphism, Abstract
2. GUI
3. Networking
4. Multithreading

Wednesday, February 8, 2012

rice (CSE412lab3 p3)


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cse412lab3;

/**
 *
 * @author LynAs
 */
public class rice extends Food{
    public void eating(){
        System.out.println("I am eating rice");
    }
   
}

Food (CSE412lab3 p2)


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cse412lab3;

/**
 *
 * @author LynAs
 */
public class Food {
   
    public void method1(){
        System.out.println("This is a food method");
    }
   
    public void eating(){
        System.out.println("I am eating.....");
    }
   
}

CSE412lab3


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cse412lab3;

/**
 *
 * @author LynAs
 */
public class CSE412lab3 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Integer num1=new Integer(20);
        String name1=new String("25");
        int x=50;
        System.out.println(num1.toString());
     
        int res=0;
       
        res = x+ Integer.parseInt(name1);
       
        System.out.println(res);
       
        System.out.println(num1.getClass());
       
       
        String name2=new String("Cse 412 Lab");
       
        System.out.println(name2.charAt(2));
        System.out.println(name2.compareTo("cse"));
        System.out.println(name2.concat(" is fun"));
        System.out.println(name2.contains("Cse"));
        System.out.println(name2.hashCode());
        System.out.println(name2.length());
        System.out.println(name2.toUpperCase());
       
        rice robj1=new rice();
        robj1.method1();
        robj1.eating();
       
    }
}

Calculator (CSE412lab3Recap p2)

CSE412lab3Recap p1



package cse412lab3recap;

/**
 *
 * @author LynAs
 */
public class CSE412lab3Recap {

 
    public static void main(String[] args) {
        Calculator cObj1=new Calculator();
        cObj1.method1();
        //cObj1.method2(6, 5);
        //cObj1.method2(2, "Max");
        //System.out.println(cObj1.summationOfNnumbers());
    }
}

Thursday, January 26, 2012

Class January 26,2012


Main Class:

package javaapplication4;

public class JavaApplication4 {

    public static void main(String[] args) {
        fun f1=new fun("ABC","M1", 20000);
        f1.drive();
        f1.drive(200);
    }
}



Car functionality class:


package javaapplication4;


public class fun {
    private String cname;
    private String model;
    private int price;
    public fun(String name,String mod, int pr){
        cname=name;
        model=mod;
        price=pr;
    }
   
    public void drive(){
        System.out.println("got a car name : "+cname);
        System.out.println("its model : "+model);
        System.out.println("its model : "+price);
        System.out.println();
        System.out.println();
    }
    public void drive(int x){
        System.out.println(cname);
        System.out.println("is driving : ");
        System.out.println(x);
        System.out.println("km/hour");
    }
   
}


Sunday, January 22, 2012

Overloading Methods


public void method(){
        System.out.println("Nothing to print");
    }
   
    public void method(String name){
        System.out.println("Hello " +name);
       
    }

Constructor


public StackOfmethod(String name, String Age){
        System.out.println("Hello "+name);
        System.out.println("Your Age " + Age );
       
       
}

*** class name StackOfmethod

access private variable


    private int x=10;
    private int y=15;
    public void accessPrivateVariable(){
        int res=0;
       
        res =x+y;
        System.out.println(res);
    }


** variable out side any method are called instance variable

Method With return Value


public int add2number(){
        int x=10,y=20,result=0;
        result=x+y;
       
        return result;
}

Method with multiple Argument


public void directedMessage2(String name, String msg){
        System.out.println("Hello " + name);
        System.out.println(msg);
}

Method with single argument


public void directedMessage(String name){
        System.out.println("Hello " + name);
}

No Argument method


public void message(){
        System.out.println("Hello Everyone");
}

Creating Object

Assume I have 2 classes one(Cse412lab2) contains the main method and the other (StackOfmethod) contains different other methods

Creating object of StackOfmethod class

StackOfmethod ob1=new StackOfmethod();