Category Archives: General

Java Packages – Tutorial 4

1. Expalin Package and what is need of package.

2. Creating Package.

/*

Code:

*/

package com.vinod;

public class Student {

private int id;
private String name;

public Student()
{
id=0;
name=null;
}
public Student(int tid,String tname)
{
id=tid;
name=tname;
}

public void setData()
{
id=0;
name=null;
}

public void setData(int tid,String tname)
{
id=tid;
name=tname;
}

public void display()
{
System.out.println(“\n ID is:”+id);
System.out.println(“\n Name is:”+name);
}
}

package com.second;

public class Employee {

private int id;
private String name;

public void setData(int tid, String tname) {
id = tid;
name = tname;
}

public void display() {
System.out.println(“\nEmployee ID is:” + id);
System.out.println(“\nEmpoyee Name is:” + name);
}
}

package com.vinod;

import com.second.*;

public class MainClass {

public static void main(String[] args) {

Student stu1=new Student();
stu1.setData(1,”Vinod Pillai”);
stu1.display();

Student stu2=new Student(2,”Abc User”); //Calling Constructor with argument.
stu2.display();

Employee emp1=new Employee();
emp1.setData(101, “Ramesh”);
emp1.display();

com.second.Employee emp2=new com.second.Employee();
emp2.setData(102, “Xyz”);
emp2.display();
}
}

http://www.youtube.com/vinodthebest

1 Comment

Filed under General

Java Constructor, Method and Static variable – Tutorial 3

1. Method Overloading.

2. Constructors.

3. Constructors Overloading.

4. Static variable and Methods.

/*

Code:

*/

public class Student {

private int id;
private String name;

private static int count;

//Constructor Overloading
public Student()
{
//id=0;
name=null;

count++;
}
public Student(int tid,String tname)
{
id=tid;
name=tname;

count++;
}

//Method Overloading
public void setData()
{
id=0;
name=null;
}

public void setData(int tid,String tname)
{
id=tid;
name=tname;
}

public void display()
{
System.out.println(“\n ID is:”+id);
System.out.println(“\n Name is:”+name);
}

//Static Method.
public static int getCount()
{
//System.out.println(“\n ID is:”+id); //Error can’t access not static Variable/Method
return count;
}
}

public class MainClass {

public static void main(String[] args) {

Student stu1=new Student();        //Calling the user defined default constructor.
stu1.setData(1,”Vinod Pillai”);

Student stu2=new Student(2,”Abc User”); //Calling Constructor with argument.
stu2.display();

int rel=Student.getCount(); //Accessing the Static method.
System.out.println(“\nThe Static result is:”+rel);
rel=0;

rel=stu2.getCount();    //Its not the correct way but this is allowed.
System.out.println(“\nThe New Static result is:”+rel);

Student stu3=new Student();
stu3.display();
}
}

 

 

http://www.youtube.com/vinodthebest

3 Comments

Filed under General

Facebook in Mobile Business

Don’t get shocked if you find a mobile phone by “Facebook” yes facebook is planning to launch a mobile phone mainly more concentrated towards to facebook application base. Hardware and OS wise not much surprise mostly probably it HTC + Android. Yes definitely it will he having modified Android as per the companies need.

photo_1364666529_temp

Read More Details

1 Comment

Filed under Android, General

Array in C

Array: An array is a collective name given to a group of similar quantities. If we would like to store 100 employee salary then we will should create an array of size 100 (int salary[100]) These similar elements could be all integers or all floats or all characters etc.

In this video I have explained about Array in C:

1. Explain Array & its need.

2. Code for entering & gettting value from Array in C.

3. Type of Array.

a. Single Dimenstion Array.

b. Multi Dimenstion Array.

Secondly I have shown code explaining how you can entering & gettting value from Array in C.


/*
Developed By:Prof. Vinod Pillai
vinodthebest@gmail.com
Array in C.
*/

#include

int main()
{
//Single Dimenstion Array
int array[5];
int i,j,rel=0;
//Multi Dimenstion Array 3 Rows & 5 Coloums each
int arr[3][5];

printf("\n Enter the Value of Array:");
scanf("%d",&array[0]);

printf("\n The result is :%d",array[0]);

//Getting the Value
for(i=0;i<5;i++)
{
printf("\n Enter the Value of Array:");
scanf("%d",&array[i]);
}

//Printing the Value
for(i=0;i<5;i++)
{
printf("\n The result is :%d",array[i]);
rel=rel+array[i];
}

printf("\nThe sum of Array values is:%d",rel);

//***************************************************************
rel=0;
//Two Dimenstion Array Getting the Value
for(i=0;i<3;i++)
{
for(j=0;j<5;j++)
{
printf("\n Enter the Value of Array:");
scanf("%d",&arr[i][j]);
}
}

//Printing the Value
for(i=0;i<3;i++)
{
for(j=0;j<5;j++)
{
printf("\n The result is :%d",arr[i][j]);
rel=rel+arr[i][j];
}
}

printf("\n\nThe sum of Array values is:%d",rel);
return 0;
}

Leave a comment

Filed under C Programming, General

Google Drive

Google much talked cloud storage Google Drive is finally here. Integrated highly with Google docs and Gmail, it also has a dedicated app for desktop and mobile phone. Currently, it is in beta phase and offering 5 GB for freeto all users.

Here is the link where you can get the invite: https://drive.google.com/start

 

 

1 Comment

Filed under General

Change LinkedIn Account Password !

Change LinkedIn Account password now. In the recent hacking spree, a hacker posted around 6.5 Million passwords stolen from various sites including LinkedIn.

LinkedIn initially tried to deny the news that the compromised password contains its data. Now as a security measure they are asking users to change the password,so please do change the password don’t ignore the pop message.

Leave a comment

Filed under General

LG Optimus 4X HD smartphone Quad-core

The first quad-core smartphone from LG Electronics, the Optimus 4X HD, is now available for purchase in Europe, the company said on Monday.

The Optimus 4X HD joins the likes of Samsung Electronics’ Galaxy S III and HTC One X, which are also powered by quad-core processors and are already on sale in Europe.

1 Comment

Filed under General