WE ARE PRESENTING YOU NEW TECH BLOG . MADE BY MY TRICKY UNIVERSE

WE WILL PROVIDE ALMOST EVERYTHING.


MY TRICKY UNIVERSE IS TECH BLOG. MADE BY HARMANJOT SINGH PANESAR EMAIL HIM


Following are the some of the Advantages of tricky tech :-

  • Easy to Setup and use.
  • email subscribers.
  • It’s beautiful on every screen size (try resizing your browser!)
by

WAP IN JAVA TO FIND NAMES.(USING ARRAYS).

 HELLO EVERYBODY I AM SHUBHAM BHARTI, CO-AUTHOR OF THIS BLOG. TODAY I AM PRESENTING YOU A NEW JAVA PROGRAM.




import java.io.*;
class names
{
int i,j,f;
String n[]=new String[20];
int l=n.length;
void enter()throws IOException
{
BufferedReader w=new BufferedReader(new InputStreamReader(System.in));
System.out.println("ENTER THE 20 NAMES");
for(i=0;i<l;i++)
{
n[i]=w.readLine();
}
}
void changes()throws IOException
{
int g[]=new int[20];
for(j=0;j<l;j++)
{
g[j]=n[j].length();
for(int k=0;k<j;k++)
{
f=g[j]-1;
}
if(n[j].charAt(0)==n[j].charAt(f))
{
System.out.println("\n"+n[j]+"\t"+j);
}
}
}
public static void main(String args[])throws IOException
{
names q=new names();
q.enter();
q.changes();
}
}

0 comments:

Post a Comment