Java Features

SIMPLE You will find java easier and simple if you are aware of object-oriented language, especially C++. Object-Oriented Java has no global functions. All functions are invoked through an object. Distributed Java facilitates the building of distributed applications by a collection of classes for use in networking application. Java can easily access a remote server using java libraries such as URL and support other protocols such as HTTP, FTP, and classes for creating socket-level connections. Interpreted Once java interpreter is ported to a specific machine…

Continue reading »

Objects in Java

You need objects for accessing the members of the class. Let’s see how to declare an objects. Syntax of Creating Objects: class_name object_name; object_name = new class_name(); Example: CodeParent cp = CodeParent(); //Declaration, Instantiation, Initialization. Accessing class members Every time you create an object of the class, the new object gets a copy of every instance variable defined in its class. For accessing the class members check the below syntax, Syntax: Object_name.data_member; Object_name.method_name(argument list); Example: CodeParent cp = new CodeParent(); cp.name = “Name1”; cp.age =…

Continue reading »

Inheritance in Java

Inheritance is an object-oriented programming technique. If you need a class similar to previous one with new additional features, java allows you to use the members of the existing class and add some more features to the new class. It is done by inheritance. The class which you derive is super class, base class or parent class. The class which is derived is sub class, derived class, child class. How to create Derived class, Syntax for creating derived class, class sub_class_name extens base_class_name { }…

Continue reading »