Thursday, August 22, 2013

For Java Students....

Please post here any query related to Java. I don't say that I have all the answers, but I assure you that even if I don't have it I will find the one for you. I hope that will work.

Monday, April 2, 2012

For Operating System Students

All the Operating System students are welcome to ask any query, try to reply them ASAP..

Monday, February 27, 2012

For Seminar 2012 Students......

Continuing with the experience from the previous year, i am again open to any kind of query regarding seminar activity for CSE/IT 3rd Year students, Please comment as try to reply back ASAP......

Friday, November 25, 2011

IPT Friday: 25th November 2011

1. Develop an applet to demonstrate the working of a "HIT-ME".
Instead of designing of a hit me, you can take a line or ellipse.

2. Develop a frame to demonstrate the working of pacman.

Just show a moving pacman with closing and opening of mouth.

3. Develop a moving snake game and control it by keyboard.

You just need to move it in a closed boundary.

4. Develop an applet to place a ball wherever you click, if the space been already occupied then ball can not be placed.

5. Create a frame to develop a mechanism to enter hobbies in a text box, on pressing enter the hobby should add in list of your hobbies. Also create a mechanism to remove a wrong entry from the list.

cs

Monday, November 21, 2011

IPT Tuesday: 22nd November 2011

1. Create an applet demo of bouncing ball in the effect of g=9.8m/s2 from a user defined height chosen by the mouse events (use anonymous inner class). In each bounce the height reduction is 20% of original one.
2. Create a demo in which a frame is changing its background continuously in random manner, along with that it is also proving you a functionality to print the series 1+1/2+1/3........n, where n would be entered using text box.
Hint: Use MultiThreading
3. Create a demo in which whenever a character has been entered in to text box it should start searching that keyword from a file and start printing the count in front of the text box.
4. Create a demo to move a ball from a very steep path, the game should get over on touching of any boundaries. Finish only when it reaches finish point without touching any of the boundary.
Use: Mouse Handing Events

IPT Monday: 21st Nov 2011

1. Create an Applet to demonstrate a tic tac toe using mouse events handling, Use Inner Classes.

2. Create a window based program to demonstrate working of psychological answering machine, Use adapter classes. i.e. take one textbox for Q and another read only textbox for answers.

3. Create a multiple ball bouncing game based applet,
Hint: Use Multithreading
Caution: They can collide

4. Create a console based survey of at least 5 Questions to find his interests about technical gadgets.
You need to log his responses in separate files for separate users.
Logging activity should be part of separate user defined package.

Wednesday, October 5, 2011

There is no call by reference in Java....

The Myth: Primitive types are called by value and Objects are passed by reference in Java.
The Truth: There is no call by reference in Java.
let's see one example:

class Democall
{int ival1=2,ival2=3;
int fun1 (int a, int b) { a=a*2; b=b*2; return(a+b); }

int fun2 (Democall obj) { obj.ival1=obj.ival1*2; obj.ival2=obj.ival2*2; return(obj.ival1+obj.ival2);}

public static void main(String args[])
{
int i=2,j=3;
Democall obj1=new Democall();//new object creation
int k=obj1.fun1(i,j);//passing i,j values to fun1's a,b
System.out.println(i+" "+j+" "+k);
k=obj1.fun2(obj1);//passing value of object obj1 to the fun2's obj
System.out.println(obj1.ival1+" "+obj1.ival2+" "+k);
}
}
output:
2 3 10
4 6 10

Now you might say: yes it is call by reference as second output is indeed changing the values of object.
But the truth lies in the memory operations of java. The function fun1 is totally fine as it is working with primitive types and indeed its is well known as call by value, but in fun2 the obj is itself passed on to the function fun2, so the value of obj1 has to be copied in to obj. Now just think what could be the value of obj1, will it not be the address of the newly created object? So the address of new Democall() is acting as the value for obj1 which would be passed as value to obj, now if obj accesses data member ival1 and ival2 it would be obviously obj1's ival1 and ival2 which ultimately got reflected in main function.
So it will give you a look and feel of a pass by reference but in the actual working it is call by value.