Java Blog

 
 
 
class greeting
{
       private String salutation;
       private String world=\"World !\";

       //Constructor
       greeting (String s)
       { salutation=s; }

       //Method
       public void greet()
       {
             System.out.println(salutation+ \"  \"+world);
        }
};

class HelloWorld
{
         public static void main(String args[])
         {
                greeting  msg = new greeting(\"Hello\");  //calling constructor
                                msg.greet();  //calling method
        }
};

    Related Post:
  1. Game application in CORBA for which player will guess a number between 1 to 100, which will be compared to the random number generated by the class

  2. An applet program that creates string dynamically and displays it

  3. RMI application for getting the final total price of the shopping list with some of the following items and quantities chosen by the user

  4. Program to show an example of getting at characters in a String

  5. Program to read input from the Standard Input Device

  6. Program of telnet server - client

  7. Program to display attributes of a specified file

  8. An applet program that displays Text at the center of the string which is passed as parameter

  9. Program to show the use of Switch Statement for the same statement for several different case labels

  10. Program to show the use of Logical or Boolean Negation i.e. NOT (!)

  11. An applet program that concatenates two string entered in TextField

  12. Program of an applet to illustrate BarChart

  13. Program in CORBA which takes a long sentence from the client (at least 7 words), passes to the server, server separates out each word

  14. RMI based application for login validation based on data saved in text file stored on the server and will display appropriate message to the client..

  15. Program of FTP client and server

  16. GUI application in java, which enter the details of a student and on the submit display the details of the student

  17. Program sets up a String variable containing a paragraph of text of your choice. Extract the words from the text and sort them into alphabetical order

  18. Corba program of game

  19. Program to show the use of Bitwise Operator (|) OR

  20. Write a program for restaurant

 
 
Didn't find what you were looking for? Find more on Program to display text