0

MCSL025 Java Lab Records 3

posted on , by Akshay Mishra

Session 7 : Multithreading  Ex 23: Write a program to launch 10 threads. Each thread increments a counter variable. Run the program with synchronization.  Code: class s07_02 { public static void main(String arg[])throws Exception { data d1=new data(); data d2=new data(); data d3=new data(); data d4=new data(); data d5=new data(); data d6=new data(); data d7=new data(); data d8=new data(); data d9=new data(); data d10=new data(); System.out.println(d10.count); ...

0

MCSL025 Java Lab Records 1

posted on , by Akshay Mishra

Session 1 : Data Types, Variables & Operators Ex 1: Write a program in Java to implement the formula (Area = Height ×Width) to find the area of a rectangle. Where Height and Width are the rectangle‟s height and width.  Code: class rectangle { int h,w; rectangle(int x,int y) { h=x; w=y; } int area() { return(h*w); } } class s01_01 { public static void main(String args[]) { rectangle r=new rectangle(10,20); int area=r.area(); System.out.println("Area of Rectangle="+area); ...

0

MCSL025 Java Lab Records 2

posted on , by Akshay Mishra

Session 4 : Inheritance and Polymorphism  Ex 10: Write a Java program to show that private member of a super class cannot be accessed from derived classes.  Code: class room { private int l,b; room(int x,int y) { l=x; b=y;} int area() {return(l*b);} } class class_room extends room { int h; class_room(int x,int y,int z) { super(x,y); h=z; } int volume() { return(area()*h); } } class s04_01 { public static void main(String args[]) { class_room ...

0

Mcs021 Notes

posted on , by Akshay Mishra

Download Lab Not ...

0

Use fullness of Tree Transversal

posted on , by Akshay Mishra

The wikipedia article has a nice concise description of when you would want to use the different types of depth-first search:Pre-order traversal while duplicating nodes and values can make a complete duplicate of a binary tree. It can also be used to make a prefix expression (Polish notation) from expression trees: traverse the expression tree pre-orderly.In-order traversal is very commonly used on binary search trees because it returns values from the underlying set in order, according ...

0

MCS022 Assignment

posted on , by Akshay Mishra

Download N ...

0

Write a shell script that searches the file contents in a directory

posted on , by Akshay Mishra

Write a shell script that searches the file contents in a directory and its sub-directories for a text string given by the user. It list all such file names having that given string and store in a temp file "search_temp". It should have user friendly messages e.g. "File does not exit" , "Do you want to search again", etc. #bin/bashread-p"Enter a filename:"filename if[[ -f $ Search_temp]] ; then echo "The file $ Search_temp exists."read –p "Enter the you word ...

0

Explain Security features Linux System ?

posted on , by Akshay Mishra

 Linux OS can be represented in the following with three layers. User, System and kernel.Kernel ,Consist of all the operating system resources such as file system ,memory, input/output modules and libraries.The System layer consist of system resources  such as Application System interface (API).And the User layer consist of all the user resources will reside such as application programs.Linux is a multi-users and multi-tasking OS. Single Linux OS can provide services for more than one ...

0

Setting up IP address to Network Card in Linux

posted on , by Akshay Mishra

STEP 1: Setting up first IP address. Edit /etc/sysconfig/network-scripts/ifcfg-eth0 on Redhat Linux box and give the following entries as shown.vi /etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth0 BOOTPROTO=static IPADDR=192.168.1.10 NETMASK=255.255.255.0 NETWORK=192.168.1.0 ONBOOT=yesSTEP 2:  Setting up second IP address. Create one file as /etc/sysconfig/network-scripts/ifcfg-eth0:1 and give the entries as below in to this file.vi /etc/sysconfig/network-scripts/ifcfg-eth0:1DEVICE=eth0:1 ...