Skip to content
Related Articles

Related Articles

Save Article
Improve Article
Save Article
Like Article

Scala Int byteValue() method with example

  • Last Updated : 30 Jan, 2020

The byteValue() method is utilized to return the byte value of the specified int value.

Method Definition: def byteValue(): Byte

Return Type: It returns the byte value of the given int value.

Example #1:




// Scala program of Int byteValue
// method 
    
// Creating object 
object GfG 
{  
    
    // Main method 
    def main(args:Array[String]) 
    
        
        // Applying byteValue method 
        val result = (15).byteValue
            
            
        // Displays output 
        println(result) 
        
    
Output:
15

Example #2:




// Scala program of Int byteValue
// method 
    
// Creating object 
object GfG 
{  
    
    // Main method 
    def main(args:Array[String]) 
    
        
        // Applying byteValue method 
        val result = (1586).byteValue
            
            
        // Displays output 
        println(result) 
        
    
}  
Output:
50



My Personal Notes arrow_drop_up