Home | Contact Us | Log In | Help
  ASP.Net & C#
  Perl and PHP
  Java Scripts
  C and C++
  Ajax Tutorials
  J2ee, J2Me, Java
  Python & Ruby Rail
  Crystal Report
  Cold Fusion & CFML
  Photoshop/Web Designing
  Tools & Utilities
  Sql Server
  Domain Name Registration
  Remotely Hosting
  Web/Server Application
  Hotel Marketing
  Internet and Law
   Search Engine Optimization/SEO
Interview Questions
Previous< 3 4 5 6 7 8 9 10 11 > Next
Programming sockets in Java
In this section we will answer the most frequently asked questions about programming sockets in Java. Then we will show some examples of how to write client and server applications. Note: In this tutorial we will show how to program sockets in Java using the TCP/IP protocol only since it is more widely used than UDP/IP. Also: All the classes related to sockets are in the java.net package, so make sure to import that package when you program sockets.
Benefits of using Java

The main benefits of using Java include the following:

1) Java programming language is very simple and object-oriented. It’s easy to learn and taught in many colleges and universities.

2) As mentioned above,Java application run inside a Java Virtual Machine and now all major operating systems are able to run Java including Windows,Mac OS and UNIX.

3) Write one and run anywhere,a java application runs on all java platforms

4) Java technologies have been improved by community involvement. This means it is suitable for most types of applications especially complex systems that are used widely in network and distributed computing

5) Java is also secure. Only Java applications that have permission can access the resources of the main computer. This means that the main computer is protected from virus attackers and hackers.

How Do These Concepts Translate into Code
Now that you have a conceptual understanding of object-oriented programming let's look at how these concepts get translated into code. The following figure shows a snapshot of the graphical user interface (GUI) presented by an example named ClickMeApp, which features a custom GUI component named ClickMe. A spot appears when you click the mouse inside the ClickMe component's area
Using With Class to Generate Java Code for All Major Java Features
To show you a more complex example, the following is the class diagram for a Car Transportation System. This diagram shows all major object-oriented relationships, e.g. inheritance, 1 to 1 association, 1 to 1 aggregation, 1 to many association, and 1 to many aggregation. This class diagram shows the Unified Method class diagram symbols: arrow - inheritance, line - association, diamond - aggregation, * - 1 to many, - private, + public, # protected, and $ static. The box enclosing the Vehicle class indicates an abstract class.
Objects in the Example
Many objects play a part in the ClickMeApp example. The most obvious ones are those with an onscreen representation: the window containing the GUI, the label describing what the user should do, the custom component that paints the initially empty rectangle, and the spot that's eventually painted by that custom component. These objects are created when the user launches the application. The application's main method creates an object to represent the entire application, and that object creates others to represent the window, label, and custom component.
Previous< 3 4 5 6 7 8 9 10 11 > Next
  Copyright 2000-2006 © SoloScript.com, All rights reserved.