Use Java to start the object-oriented programming
Do you are moving from traditional pro processs to target object-oriented development models? Or do you want to enter the expanded Java world? You don't feel lonely. Thousands of developers and you are in the same situation In this series of articles, we will use the Java language to lead you a step-oriented development process. Below is the first one of our series: Is a language to object-oriented? If one The programming language is the true object-oriented language, which must support the following features: Package - Hide Realization Detail Polymorphism - Send the same message to different objects and make each object respond to the message in a predetermined manner Ability inheritance - expands the existing class to generate a special class inheritance of the status and behavior of the active dynamic binding - Do not need to know the specific type of object when programming, let us find Java How to support these functions and how it provides additional features to make the transformation process of object-oriented development to the transformation process of object-oriented development. Java is the object-oriented feature Java is from Sun Microstems in the 1990s. Object-oriented (OOP) programming language. You can download the latest Java development kit (JDK) from Sun's website. Java is an interpretative language, which means that its source program is first compiled into an intermediate The form of the code, then the explanation of the virtual machine before running, it is a completely-directed object-oriented programming language. Java processor hides many traditional object-oriented programming languages - computes C and Object Pascal - The complexity and is easier to confuse. For example, there is no pointer in Java. Java will automatically clear the reference type for programmers, and all variables will be automatically initialized into an appropriate default value. In addition to the original data type Everything in Java is an object. When necessary, it can also provide a package mechanism for the original data type. Object introduction object is a software programming entity representing the real life, such as bank account, computer users, user interface The button, window menu, etc. Objects are defined by their status and behavior. For example, a bank account has a state, such as the current payment situation, owner of the account, allowed minimum transaction amount, etc. And its behavior includes extraction, deposit, balance balance. The status of an object is defined by the variable that only object you know, is called these variables as a data domain or a member variable. Data domain It is private unless explicitly uses keywords to define their scope, allowing them to be visible to other classes. We will discuss the problem of variable scope. One object is defined by the operation above. In Java Among them, these operations are called methods. Method can change the status of an object, create new objects, implement practical functions. Category is an entity It defines an operation mode of an object and the data contained in the object when the object is created or instantiated. The role of the class is like a template, one or more objects can be created in accordance with it. Below is an object-oriented object-oriented using Java Concept of applying HelloWorld application: public class helloworld {private string hellomsg = "Hello World!"; Public static void main (string [] args) {helloworld hw = new helloworld ();} public helloworld ()} Show our "Hello World" message system.out.println (Hellomsg);
}} The above example defines a template. The real HelloWorld object can be created from this template. You will also notice a strange code from the PUBLIC VOID MAIN (String [] args). This section code is defined. It is a special method main, which is actually the entry point of our HelloWorld program, the above program is a typical demonstrations all Java applications how to define their entry points. Notice that even this main entry point is also packaged In this example. For this example, we are packaged in the HelloWorld class. The above program shows how to define a class, HelloWorld, and one of the data domains, hellomsg, and two methods main and helloWorld.HelloWorld methods are one Special methods, this method is called a constructor. We will discuss the details and differences of conventional methods, constructors, and static member functions in later articles. In Java, all source code related to a special class Write in a file with the same name. Java. Java compiler reads the source file and translates them into platform-independent, binary format code, becomes byte code, and then saves these code categories The class is the same name but the suffix is. Class file. You will eventually get a class file for each class. Compile and run our example once you have downloaded JDK from Sun's Web site and install it on your machine It can start compiling and run the Java program. To compile and run our example, paste the HelloWorld class code into your favorite document editor, save the file as helloWorld.java, then, Under the command prompt, change the current path to the path containing this file. Now you can type the following command to compile the command: Windows:
The last time I learned a programming language to really be object-oriented, it should support information hidden / encapsulation, polymorphism, inheritance, and dynamic binding. In addition, we I know that Java fully supports these functions, and knows that Java is an interpretative language and runs inside the virtual machine, so any programs written by Java can be on any operating system that supports Java Virtual Machine (JVM). Operation. We also understand that the object is a software-programming model representing things in real life - programming models and objects are defined by their status and behavior. Finally, we know that everything other than the original data object is object. Because of this Many of the contents of the program design style are related to the objects and classes. We will further examine them in the following. The object of the object uses the object of the object is how to determine them when you browse the system analysis document or design documentation. Because objects generally represent people, local or things, a basic way to determine the object is to find the nouns used in the sentence. There is a simple example. In the sentence "a customer can have more than one bank account", We have identified two objects, customers and accounts. In the sentence "Kitten 喵 喵", we can determine an object, a cat. In front of the class, we have learned a class is how the object is defined and the object What entities should be included when creating or instantiation. In the discussion of animals, we can say, "Dogs Wang Wang, the cat is called, the duck is called." Determine the object in the sentence we got it. Dogs, cats and ducks. As for Wang Wang, 喵, 嘎 叫 嘎,, it is the behavior movement of our object. To implement these objects, we need to create three objects called Dog, Cat and Duck. To implement them Behavior, we can create a method of sound emitted by each object, and we call this method Speak or if we play the imagination, you can call this method as Sayello. In the context of the program, in order to demonstrate These concepts, let us modify the HelloWorld program in the article, add these three new objects and add a SayHello method to each of them, as shown below: public class helloworld {public static void main (string [] args) { Dog animal1 = new DOG (); CAT Animal2 = new cat (); duck arnimal3 = new duck (); Animal1.SAYHELLO (); Animal2. Sayello (); Animal3.SAYHELLO ();}} class dog {public void sayhello () {system.out.println ("bar");}} Class Cat {PUBLIC VOID SAYHELLO () {system.out.println ("Meow ");}} Class Duck {PUBLIC VOID SAYHELLO () {system.out.println (" quack ");}} After compiling and running this program, the output should be as follows: Bark MeionQuack looks at our program, we will immediately Noted some things: Each object represents an animal, and each object has realized an identical method, Sayhello. Suppose we want to give more functions and methods and properties used to represent objects referred to. For example, we can add a method to determine whether an animal is not breastfeeding, or we add a method to determine that one animal is not a meat. We can add these two ways to each object or us It is also possible to use OOP's two most powerful features: inheritance and polymorphism. Because all objects represent an object, we will create a "base class" or "super class"
The class, its name is Animal. We can then let our objects inherit the same feature from the Animal class and force each object to implement different features with the Animal class. Java specifies a class from another inheritance with an Extends keyword. Let us use inheritance and polymorphic concepts to get the benefits of code reuse to rebuild our procedures and make each object differently different features: public class helloworld {public static void main (string [] args) {dog Animal1 = new DOG (); CAT Animal2 = new cat (); duck arnimal3 = new duck (); system.out.println ("a dog say" animal1.gethello () ", IS carnivous:" Animal1. ISCarnivorous () ", IS A Mammal:" Animal1.isamammmal (); System.out.Println ("a cat sign" animal2.gethello () ", IS Carnivors:" Animal2.iscarnivors () ", is a mammal:" Animal2.isamammal ()); System.out.Println ("a Duck Says" Animal3.GetHello () ", IS Carnivors:" Animal3.iscarnivors () ", IS A mammal: " animal3.isAMammal ());}} abstract class Animal {public boolean isAMammal () {return (true);} public boolean isCarnivorous () {return (true);} abstract public String getHello ();} class Dog extends Animal {public String getHello () {return ( "Bark");}} class Cat extends Animal {public String getHello () {return ( "Meow");}} class Duck extends Animal {public boolean isAMammal () {Return (false);} public boolean iscarnivorous () {return (false);} public string getHello () {Return ("quack");
}} After compiling and running our programs, the output should be as follows: A Dog Says Bark, IS Carnivors: True, IS A Mammal: Truea Cat Says Meow, IS Carnivors: True, IS A Mammal: Truea Duck Says QUACK, IS Carnivors : false, is a mammal: false Look at our example, you will find that we define a new class called Animal, which defines three ways: isamammal, iscarnivorous, and gethello. You still noticed, we are The extensions Animal statement has been added in front of the existing classes. This statement tells the compiler that these objects are subclasses of the Animal class. Because ISAMMMAL and ISCARNIVORS have returned True, so DOG and CAT are not re-real - ie "Overload" These two methods. But the duck is neither a mammal is not a meat, so the DUCK class needs to overload these two methods to return the correct value. All our objects say "Hello" in its own unique way ", So they all need to overload the GetHello method. Because each animal says that" Hello "is different, we declare the GetHello method as abstraction in the base class, and we did not give this method a function body. This Forcing each subclass of Animal to overload the GetHello method and define it according to the needs of each particular animal. Because we declare the GetHello method as virtual, we can't directly instantiate animal object. So, we need to put the Animal class Declaration is abstract. We have achieved this by adding the Abstract keyword to the starting line defined by the Animal class. The ability of the subclass to overload their base classes is polymorphism. Polymorphism makes subclasses to use base classes or It is overloaded when these methods are insufficient. This realizes the code reuse, speeding up the implementation process of code, and it is also isolated and the bug in the program, making the program maintenance easier. Summary in this article, we have learned How to determine potential objects. We also learned how to use inheritance and polymorphism to speed up our code implementation process and isolate errors, which makes the code maintenance process easier. Next, we will launch the concept of discussing polymorphism and inheritance Start our discussion of dynamic binding .oop: inheritance and polymorphism
In the article "OOP profile: understanding and object", we discussed the benefits of inheritance and polymorphism. We are still roughly learning how to extend the base class definition subclass, inherit the appropriate behavior and attributes in the base class. Obtaining those acts and attributes that are not suitable. This way can reduce the code macro and the incorrect accumulation. Now we will more in-depth inspections and how Java handles it. We will also learn dynamic binding To learn polymorphism. In-depth inheritance Some object-oriented languages provide "multiple inheritance" characteristics, which is valuable when an object needs to inherit behavior and attributes from more than one base class. Multi-inheritance is in some The situation is complicated. For example, suppose we need to define a base class, Animal, then the two subclasses of Animal, Landanimal and Wateranimal. Now we want to define a class to represent the frog. Frog is amphibians, so we will naturally Think of the definition from Landanimal and WateraNimal class. This allows the Frog class to inherit the behavior and attributes you need from Landanimal and WateraNimal class. It seems that this is quite simple; however, let us add a Livingenvironment for Animal Attribute, and use method getLivinGenVironment to return it. We assume that the Landanimal and WateraNimal classes have overloaded this method to implement special features. Slandanimal will return to the value of its LivinGenvironment property, while WateraNimal will return to Water as its LivinGenvironment properties Value. Now, when we use the Frog class as the Landanimal and WateraNimal subclass implementation, we want to get the LivinGenvironment attribute value of Frog, which will encounter a trouble: The getLivinGInvironment method of the Frog class is to return the LAND value or a Water value? The answer depends on how the compiler handles multiple inheritance. I have said in the previous article, Java does not support multiple inheritance. But it does allow an object to have multiple characteristics by using the "interface" function. The following example shows Possible definition code for defining the interface of Landanimal: public interface landanimal {public interface landAns (); public boolean Hasatail ();} A class using the interface adds the IMPLEments interface name of the class definition statement. For example, in Java, we The frog class is defined in the following manner: public class frog extends Animal Implements Landanimal, the WateRanimal interface does not have any actual features; their role is to contact the user and implement this interface object. The interface guarantees the object implementation interface definition Method. Moreover, an object that implements an interface can be forced into an interface type at runtime. For example, use the above Frog definition, and assume that the Landanimal class defines a method called getNumberoflegs and WateraNimal defines a method called HASGILLS. Then an example of a Frog class can be enforced to Landanimal or WateRanimal objects at runtime: frog AFROG = New frog (); int legcount = (LANDANIMAL) AFROG) .GETNumberoflegs (); boolean gillflag = ((Wateranimal) AFROG .hasgills (); Note For why Forg can be forced to convert into a Landanimal object Even if the actual Landanimal object is not created. This makes we call an object when running with any "identity" it has, this is the so-called "Dynamic Binding" or "Running Binding". Deepening polymorphism Java uses dynamic binding to make the polygon possible, it refers to the mechanism of the method or object of Java to select a call at runtime. Overload The special polymorphic mechanism in Java is constituted, which is manifested in two or more methods of a class, but different parameter lists, or "method signature"
The signature of a method refers to the name and number of methods and the number of parameters. Each method of the class has a unique signature associated with it. Class can have multiple names the same method as long as their parameter list is unique For example, we can define two names GetHello to the Animal class, with one of the methods to get the usual call, and use another call when the animal is frightened or smashed. We will give Each method is the only signature: public string getHello (); public string getHello (INT MOOD); now let us modify the example program to put some of the concepts we discussed into practice: public class helloworld {public static void main (String " ] args) {dog animal1 = new DOG (); Cat Animal2 = new cat (); duck arnimal3 = new duck (); system.out.println ("a dog sign" animal1.gethello () ", When Scared Says: " Animal1.Gethello (Animal.Scared) ", IS Carnivors: " Animal1.iscarnivors () ", IS A Mammal: " Animal1.Isamammal ()); System.Out.println (" a cat Says " Animal2.gethello () ", When Comforted Says: " Animal2.gethello (Animal.Comforted) ", IS Carnivors: " Animal2.iscarnivors () ", IS A Mammal: " Animal2.isamamMal ()); System.out.Println ("a Duck Says" Animal3.GetHello () ", When Scared Says:" Animal3.GetHello (Animal.Scared) ", IS Carnivorous:" Animal3.iscarnivors ) ", IS A Mammal:" Animal3.Isamammal ());}} Abstract Class AN imal {public static final int SCARED = 1; public static final int COMFORTED = 2; public boolean isAMammal () {return (true);} public boolean isCarnivorous () {return (true);} abstract public String getHello (); abstract public String getHello (int mood);} interface LandAnimal {public int getNumberOfLegs (); public boolean hasATail ();} interface WaterAnimal {public boolean hasGills (); public boolean laysEggs ();} class Dog extends Animal implements LandAnimal {// Method of heavy duty parent class public string getHello () {Return ("bar");
} public string getHello (int Dong) {switch: return ("growl"); case comforted: return ("");} Return ("bar");} // Landanimal interface implementation public int Intelligence PUBLIC INT GetNumberofLegs () {RETURN (4); PUBLIC Boolean Hasatail () {Return (TRUE);}} Class Cat Extends Animal Implements Landanimal {// Reserved Method of Double Parent String GetHello () {Return ("meow") PUBLIC STRING GETHELLO (INT MOOD) {Switch (Mood) {Case Scared: Return ("Hiss"); Case Comforted: Return ("Purr");} Return ("Meow");} // Landanimal Interface Implement PUBLIC INT getNumberoflegs () {return (4);} public boolean Hasatail ()} Class Duck EXTENDS Animal Implements Landanimal, WateRanimal {// Reserved Parent Class Method PUBLIC STRING GETHELLO () {Return (" ");} Public string getHello (int Mood) {switch (mood) {Case Scared: Return (" Quack, Quack, QUACK "); Case Comforted: Return (" ");} Return (" Quack ");} public boolean isAMammal () {return (false);} public boolean isCarnivorous () {return (false);} // WaterAnimal interface public boolean hasGills () {return (false);} public boolean laysEggs () {return (true } // Landanimal interface implementation public i NT getnumberoflegs () {return (2);} public boolean Hasatail () {return (false);} The result of the output after execution is as follows: A DOG SAYS BARK, WHEN Scared Says: Growl, IS Carnivors: True, IS A Mammal: Truea Cat Says Meow, When Comforted Says: Purr, IS Carnivors: True, IS A Mammal: Truea Duck Says Quack, When Scared Says: QUACK, QUACK, QUACK, IS Carnivors: False, IS A Mammal: False Summary Comprehensive Inheritance The concept of polymorphism and interface provides a set of powerful programming tools that allow us to reuse code, isolation errors, and get the benefits of dynamic / runtime bindings. In the next article, we will discuss how to use Java's variable scope / visible domain rules to control the issue of exposure of methods and properties. OOOP: Access to Limit Object Properties In "OOP Getting Started: In-depth Research Inheritance and Polymorphism", we continue to discuss inheritance and more The advantage of the state. We also learned other things:
Although Java only supports inheritance from a parent class, it supports multiple inheritance in the way. The interface implements a polymorphism, making us give different features to the object to meet different needs. You can use the polymorphism to complete similar features Different methods have the same name but have a different parameter list. Dynamic / runtime binding mechanism allows an object to be forced to convert to the type of object you need at runtime, premise this object implements the necessary interface or The specific parent class is included. Below we will discuss the purpose and practicability of the correct use of multiple interface implementations and parental development through restrictions on object properties and methods. Black box method: Package a basic object-oriented The concept is package-will be separated from other objects to other objects. This is to achieve a concept that is typically called the scope. The scope refers to a programming language, this ability It is used to implement a rule that restricts access to class or structural member variables. Most object-oriented language supports a domain mechanism, which is usually implemented by special keywords such as public, protected, and private. .Java offers four different scope of scope: public, package, protected, and private. Any class, method, or member variable can explicitly protected by using public, protected, and private keywords. Any class, method Or member variables will be implicitly given the scope of Package if not using the keywords above. All of this constitutes a concept of namespace in Java. Namespace and packages a namespace can be seen as A set of related names or identifiers in a given context. Namespaces Avoid existing entities with the same name or identifier existing in the same context. Here, it means that as long as the entity is existing in different namespaces In that, then entities with the same name or identifier can stay in. Java uses the concept of the package to achieve namespace and scope control. The package is a collection of classes and interfaces under unified names. A class or interface must exist in the namespace defined by the package application statement configured with the package keyword. For example, the following declaration statement: package com.mycompany.Apps.Helloworld; it has declated an existence in com.mycompany. A class or interface called HelloWorld in the Apps package. The package declares that it is always placed on top of files that contain classes or interface definitions. In the Java development world, there is a suggestion for the name of the package, that is, using the company or The organization's domain name (in the opposite order), as the first part of your package. Because the domain name is only the world One, so using your domain name to name your package can also make your package worldwide worldwide. If a Java class or interface does not include a package declaration, then it belongs to "unaged package," The name of the software package. Unnamed packages should only be used to test programs or code prototypes. Please try to use the package mechanism in any program, especially in object-oriented programming, the exposed programming interface Details are hidden. This makes the low-level implementation method to change without affecting the existing clients existing in the programming interface, and can make objects to manage their own status. Separation interface and implementation methods Steps are the hidden internal data. To make a member variable or method for all potential customers in Java, you can declare it with the private key to declare it as a private member variable, as shown below: Private int Customercount; A member variable or method is not visible to all potential customers in Java in addition to the subclasses they belong to Java, which can be declared using protected keywords into protection types, as follows: protected int customercount; make a member variable Or the method is not visible to all potential customers in Java in addition to its own class, not using any keywords, as shown below: int CustomerCount; To expose a member variable or method to all of its class Customers, you can declare it as public member variables with public keywords, as follows: Public int CustomerCount;
Accessing member variables are hidden by an object's data, customers still need to access some hidden data. This is implemented by calling functions or methods. In Java, use specially known as a property accessor method to access Hidden data is possible. There is no essential difference between the attribute accessor and the usual function in Java. The only thing to change into a property accessor is the only thing to do with a naming rule to add a method. Naming rules of the accesser of the data is to name the method as the same name as the data field, write the initial capital, and then add a GET or IS in front of the method name. "Write" data accessor Naming rules are named To the same name as the data domain, add the first letter, and then add a set in front of the method name. The following example demonstrates the data accessor method of writing and reading data. This is a "read" data accessor method: public int INT GetCustomerCount () {return (CustomerCount);} This is another "read" data accessor method public int iScustomerActive () {return (customerActive);} This is a "write" data accessor method: public void setcustomercount (int newValue Use the accessor method to allow other objects to access an object's hidden data without directly involving the data domain. This allows you to have an object of implied data to do correctly check and control the member variable before changing the member variable. It should be set to a new value. Now let us modify the example program to use these concepts, as shown below .public class helloworld {public static void main (String [] args) {dog animal1 = new dog (); cat animal2 = new Cat (); Duck Animal3 = New Duck (); Animal1.SetMood (Animal.comForted); System.Out.println ("a comforted dog says" animal1.gethello ()); Animal1.StMood; System.out.println ("A Scared Dog Says" Animal1.GetHello ()); System.out.Println ("Is A Dog Carnivorous?" Animal1.iscarnivors ()); System.out.Println ("Is A Dog A Mammal?" Animal1.Iscarnivors ()) Animal2.SetMood (animal.comforted); System.out.Println ("a comforted cat says" animal2.gethello ()); Animal2.StMood; System.Sunt.Println ("A Scared Cat Says " Animal2.gethello ()); System.out.Println (" Is a cat carnivorous? " animal2.iscarnivorous ()); system.out.println (" is a cat a mammal? " animal2.iscarnivorous () Animal3.SETMOOD (Animal.comforted);
System.out.println ("a Comforted Duck Says" Animal3.GetHello ()); Animal3.StMood; System.Out.Println ("a Scared Duck Says" Animal3.getHello ()); System .out.println ("is a duck carnivorous?" animal3.iscarnivous ()); system.out.println ("is a duck a mammal?" animal3.carnivorous ());}} Abstract Class Animal {// The two following fields are declared as public because they need to be // accessed by all clients public static final int SCARED = 1; public static final int COMFORTED = 2; // The following fields are declared as protected because they need to be / / accessed only by descendant classes protected boolean mammal = false; protected boolean carnivorous = false; protected int mood = COMFORTED; public boolean isMammal () {return (mammal);} public boolean isCarnivorous () {return (carnivorous);} abstract public String getHello (); public void setmood (int newvalue) { mood = newValue;} public int getMood () {return (mood);}} interface LandAnimal {public int getNumberOfLegs (); public boolean getTailFlag ();} interface WaterAnimal {public boolean getGillFlag (); public boolean getLaysEggs ();} class Dog extends Animal implements LandAnimal {// The following fields are declared private because they do not need to be // access by any other classes besides this one private int numberOfLegs = 4;. private boolean tailFlag = true; // Default constructor to Make Sure Our Properties Are Set Correctly Public Dog () {Mammal = True; Carnivorous = true;
} //Methods That Override Superclass's Implementation Public String GetHello () {Switch (Mood) {Case Scared: Return ("GROWL"); Case Comforted: Return ("Bark");} Return ("bar");} // Implementation of LandAnimal interface public int getNumberOfLegs () {return (numberOfLegs);} public boolean getTailFlag () {return (tailFlag);}} class Cat extends Animal implements LandAnimal {// The following fields are declared private because they do not need to . be // access by any other classes besides this one private int numberOfLegs = 4; private boolean tailFlag = true; // Default constructor to make sure our properties are set correctly public Cat () {mammal = true; carnivorous = true;} //Methods That Override Superclass's Implementation Public String GetHello () {Switch (Mood) {CASE Scared: Return ( "Hiss"); case COMFORTED: return ( "Purr");} return ( "Meow");} // Implementation of LandAnimal interface public int getNumberOfLegs () {return (numberOfLegs);} public boolean getTailFlag () {return (tailFlag);}} class Duck extends Animal implements LandAnimal, WaterAnimal {// The following fields are declared private because they do not need to be // access by any other classes besides this one private boolean gillFlag = false;. private boolean laysEggs = true; private int numberoflegs = 2; private boolean tailflag = false;
// Default constructor to make sure our properties are set correctly public Duck () {mammal = false; carnivorous = false;} // methods that override superclass's implementation public String getHello () {switch (mood) {case SCARED: return ( " quack, quack, quack "); case COMFORTED: return (" quack ");} return (" quack ");} // Implementation of WaterAnimal interface public boolean getGillFlag () {return (gillFlag);} public boolean getLaysEggs () {return (laysEggs);} // Implementation of LandAnimal interface public int getNumberOfLegs () {return (numberOfLegs);} public boolean getTailFlag () {return (tailFlag);}} the output of this procedure should be as follows: a comforted dog says Barka Scared DOG SAYS GROWLIS A DOG Carnivorous? Trueis A DOG A MAMMAL? TRUEA Comforted Cat Says Purra Scared Cat Says Hissis a cat carnivorous? Trueis a cat a mammal? Truea Co Mforted Duck Says QUACKA Scared Duck Says QUACK, QUACK, QUACKIS A DUCK Carnivorous? Falseis A Duck A Mammal? False Summary Using Data Hide / Packaging Mechanism is a powerful way to control object data and status. It allows an object to decide whether to want Changing a member variable and how to change a member variable. This makes an object's implementation details to maintain the exposed object interface to maintain. In our next article, we will further explore the variable scope rules provided by Java and start Learning the Java objects how to construct and initialize. Java learning magical initialization Java has a lot more attention when initialization, because the classes appear in Java, so it is possible to create new objects when initialization, so for initialization The order requirement is strict, please see the following programs, it is a program in Thinking in Java, which is slightly adapted, so you can better illustrate several initialization points: Class Cup {CUP (Int marker) {system .out.println ("CUP (" Marker ")") ");} void f (int marker) {system.out.println (" f (" marker ") ")