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.

Friday, September 30, 2011

Thanks to IT 3rd Year students...

I thank my all IT 3rd year students for their encouragement and motivation by which i have been able to achieve SCJP 6 ( Oracle JSE 6 Programmer Certified Professional Exam) certification on 30-09-2011. Thanks once again.....

Tuesday, September 6, 2011

volatile, transient and instanceof in Java...

volatile: a volatile keyword tells the compiler that the variable value can change unexpectedly by other parts of your program. In java sometimes if threads share some variable, for efficiency they all keep their private copy of the shared variable. at certain positions specially in synchronized constructs most updated copy must be referred, so volatile tells the compiler that always use the master copy for volatile variable or keep it as updated as possible.

transient:
a transient variable has two objectives in declaration :
1. it must not be serialized
2. it must not persist on storing it in permanent storage area.
i.e. when you store object in hard disk, it would be composed of combination of values of all its data members except transient variable.

instanceof:
objectRef instsnceof ClassName return boolean. It is an operator which is used to determine the object with the class name. Its not only match it with its ClassName but even with its parent. However it returns false on null.
E.g. class A{}
class B extends A{}

B objB=new B();
A objA=new A();
B objB1=null;
objB instanceof B//returns true
objB instanceof A//returns true
objA instanceof A//returns true
objA instanceof B//returns false
objB1 instanceof B//returns false
objB1 instanceof A//returns false

Wednesday, August 10, 2011

Java is not a Purely Object Oriented Language....

As Java is supporting all the features of being Object oriented like inheritence, encapsulation etc. but the primitive types of Java i.e. int, char, bool etc. are not objects which is one of the important condition to be purely object oriented. If still have any query please comment...

Monday, July 11, 2011

For Seminar CSE Students...

If you have any query or suggestions regarding seminar activity, please comment I will try to reply to best of my capabilities....

Wednesday, April 13, 2011

OS Second term related comments

Some topics regarding second sessional as initiated by ankita
Synchronization
1. All Three basic solutions of synchronization.
2. Bakery Algo.
3. Semaphores- both counting and binary.
4. All Classical problems of synchronization.
5. Critical Regions and monitors.
6. Atomic transactions.
Disc Mgmt
1. All Disc scheduling Algos- remember calculations of distance and memory map.
2. All the latencies and terminology associated with disc working.
3. RAID.
4. Sector sparing and slipping for bad sectors management.
5. Swap space management.
Deadlocks
1. Deadlock conditions.
2. All prevention, avoidance, recovery techniques theory.
3. Do practice safety and resource request, and deadlock detection algos thoroughly with example.
4. How to combine the deadlock approaches.
Device Mgmt
Totally theoretical so nothing can be said about about any one topic.

This is just the my perception about the topics listed here, this is nowhere decrease or increase the importance of any topics which are not listed here, and i personally encourage all the students to read the entire syllabus thoroughly and study all topics very sincerely.
All the best to all.
If any one has any more queries to ask please comment, will try to reply soon.

Wednesday, February 2, 2011

For OS Students...

Please put up any query of yours regarding OS concepts, mention any suggestion or any thing you would like to share...

Tuesday, December 21, 2010

Questions Set 4

1. what is client and server side coding?
2. what are servlets?
3. what type of sockets are available in java?
4. Package for networking?
5. How to access param values in html doc in applet ?
6. How to open a frame inside an applet or frame?
7. Is java a free form language, Justify your answer?
8. What is current version of java?
9. AWT stands for?
10. Byte code and class path?
May be more.. i am still in thinking and searching mode..... All the best for viva :-)

Friday, December 17, 2010

viva and interview question set 3

1. What is the difference between java and native classes?
2. what are jar files? How they are used in creation of a bean?
3. Different access specifiers used in java?
4. What are labeled loops?
5. Which type of inputs are permitted to be used in switch statements?
6. Difference between if else and assert statements?
7. Only pointer available in java is ?
8. Difference between Java and javascript?
9. What are manifest files?
10. What is the default font in java?

Thursday, December 16, 2010

new set of viva and interview ques

1. What is the difference between logical and arithematic right shift?
2. What are different type of operators in java?
3. What is original name of java and who is the creator of it?
4. What is java's ''write once and run anywhere'', how it is achieved?
5. What is the difference between throw, throws and throwable?
6. What is the difference between exception and error?
7. What is unreachable code, how it occurs in java?
8. Why java named as java?
9. Explain java's strong type checking?
10. What is motivation behind creation of java?

Wednesday, December 15, 2010

viva and interview based questions

here is an example of some viva questions:
1. What is static import statement?
2. Static block
3. Which block would be executed before main?
4. Purpose of garbage collection, how it can be forced?
5. Hash map and hash table?
6. Vector and array list?
7. Swing and awt?
8. Final, finally and finalize?
9. what happen if main method is declared as private?
10. == and compareTo in Strings
11. Why main is Public static void main?
12. JVM and JRE?
13. update and paint in applet?
keep looking here for more questions.....

Thursday, December 9, 2010

Important Facts about Java programming..

Important Basic Facts about Java

1. Multiple Inheritance can be achieved with the help of interfaces as they don’t implement any function just give a guidelines for the implementation.

E.g.

interface S{final int a=0;}

interface A extends S{}

interface B extends S{}

interface C extends B,A{

}

class Multiple implements C

{

public static void main(String args[])

{

System.out.println(a);

}

}

Output: 0

2. Parent class always passes its own function to the child with its definition in inheritance. So while re-implementation of any interface already implemented by the parent does not make any compulsion for the child class.

E.g.

interface S{final int a=0; void fun();}

interface A{void fun1();}

interface B extends S,A{void fun2();}

abstract class Abst implements B

{

public void fun(){System.out.println("Abtract");}

}

class last extends Abst implements S

{

public void fun1(){System.out.println("lastfun1");}

public void fun2(){System.out.println("lastfun2");}

}

class MultImp{

public static void main(String args[])

{

last l =new last();

l.fun();l.fun1();l.fun2();

}

}

Output:

Abtract

lastfun1

lastfun2

3. Multiple Inheritance in no way can be implemented in Classes

4. All the functions in Java are virtual by default so always support Run Time Polymorphism.

5. Anonymous Inner Class Advantage: It reduces the code size, and also does not create a separate class file for adapter. Disadvantage: It cannot be reused if required at the later stage.

6. Threads can be created using two methods:

a. Implements Runnable Interface: need object of Thread class

b. Extends Thread Class: The object of extended class itself act as a new Thread.

7. MenuBar have Menus which can have Menuitem, CheckboxMenuItem as well as Menu (which act as submenu).

8. Update is called in Paint whenever it is required to save the previous content intact.

9. Objects are called by reference and Variables are called by value.

10. Autoboxing : when a basic type is converted into a wrapper type.

11. Unboxing : when a Wrapper type is converted into a basic type.

IPT Thursday

Internal practical examination

(thursday)

Experiments:

Divisble by 5: CREATE A FRAME MECHANISM TO DEMONSTRATE THE APPEARANCE OF GLOWING SUN AT THE EXACT CENTER OF THE SCREEN. IT SHOULD INCREASE AND DECREASE ITS GLOWNESS PERIODICALLY.

Divisible by 4 & not by 5: CREATE A CONSOLE MECHANISM TO DEMONSTRATE THE WORKING OF TWO SEMAPHORE LOCKS FOR SYNCHRONIZATION. AVOID DEADLOCK.

Divisible by 3 & not by 5 and 4: CREATE AN APPLET APPLICATION TO DEMONSTRATE WORKING OF OPENING SORTING THE LIST OF NAMES SUPPLIED AS PARAMETER FROM HTML DOCUMENT. FOR E.G. 'ABILITY' SHOULD COME BEFORE 'AGILITY'.

Divisible by 2 & not by 5,4 and 3: CREATE A SWING APPLICATION TO OPEN A FILE AND THEN PRINT THE LIST OF ALL THE WORDS REPEATED MORE THEN ONCE IN THE WHOLE FILE.

REST OF ALL: CREATE AN APPLET TO DEMOSTRATE THE DROPPING OF A GLASS BALL FROM A HEIGHT SELECTED BY MOUSE ON TO A FIXED PLATFORM. USE MOUSE EVENTS AND REMEMBER ''IT IS A GLASS BALL''.

Wednesday, December 8, 2010

IPT Monday Question..

for your kind references please find below the Questions given to students on Monday..

Internal practical examination

(monday)

Experiments:

No. 1:

Divisble by 5: CREATE AN APPLET MECHANISM TO DEMONSTRATE THE CALCULATION OF AGE ON SELECTION OF DATE OF BIRTH. USE EVENT HANDLING.

No.2

Divisible by 4 & not by 5: CREATE A FRAME MECHANISM TO DEMONSTRATE THE WORKING OF COUNTDOWN STARTING FROM 1HR:00MIN:00SEC AND SHOULD STOP AT 00:00:00. USE MULTI THREADING.

No.3

Divisible by 3 & not by 5 and 4: CREATE A CONSOLE APPLICATION TO DEMONSTRATE WORKING OF FCFS PROTOCOL FOR P1(6), P2(2), P3(1). USE THREAD WAITING FUNCTIONS.

No.4

Divisible by 2 & not by 5,4 and 3: CREATE AN USERNAME AND PASSWORD ACCEPTANCE FORM & SHOW MESSAGE AS WELCOME OR WRONG USERNAME/PASSWORD MESSAGE ACCORDINGLY. TAKE USERNAME: Admin & PASSWORD: ABC@123 AS VALID.

No.5

REST OF ALL: CREATE A CONSOLE APPLICATION TO COUNT NO. OF WORDS, LINES AND CHARACTERS IN A FILE. THE COUNT FUNCTION HAS TO MADE COMPULSORY FOR THE IMPLEMENTING CLASS. USE INTERFACES.