Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Scala Char getDirectionality() method with example

  • Last Updated : 03 Nov, 2019

The getDirectionality() method is utilized to return byte which indicates the directionality property of the char value.

Method Definition: def getDirectionality: Byte

Return Type: It returns byte.

Example: 1#




// Scala program of getDirectionality()
// method
  
// Creating object
object GfG
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying getDirectionality() method 
        val result = ('7').getDirectionality
          
        // Displays output
        println(result)
      
    }
Output:
3

Example: 2#




// Scala program of getDirectionality()
// method
  
// Creating object
object GfG
  
    // Main method
    def main(args:Array[String])
    {
      
        // Applying getDirectionality() method
        val result = 'B'.getDirectionality
          
        // Displays output
        println(result)
      
    }
Output:
0

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!