It's really exciting for new learner to write her/his own name in new language..
Same thing happen when you learn java and write a program that prints a beautiful line saying hello to your name..
Below code in Code Box takes your name as argument and print hello with your name.
Try it on your computer and try to modify the program by adding some more information about you.
Code Box
Same thing happen when you learn java and write a program that prints a beautiful line saying hello to your name..
Below code in Code Box takes your name as argument and print hello with your name.
Try it on your computer and try to modify the program by adding some more information about you.
//A program to print hello "your_name"
class name
{
public static void main(String a[])
{
String yname;
yname=a[0];
System.out.println("hello "+yname);
}
}
|
If you want to make it more better do your own experiments!!
Don't limit your self & find some more programs to do...
Just for your hint!!
Code Box 1
//A program to print hello "your_name" & "city"
class name
{
public static void main(String a[])
{
String yname,city;
yname=a[0];
city=a[1];
System.out.println("hello "+yname);
System.out.println("you are from "+city+", nice to meet you!!");
}
}
|
0 comments:
Post a Comment