PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0
Showing posts with label unary-operator. Show all posts
Showing posts with label unary-operator. Show all posts

Monday, September 19, 2022

[FIXED] What is the difference between Unary-Operator functional-interface to Consumer functional-interface?

 September 19, 2022     consumer, functional-interface, java, unary-operator     No comments   

Issue

I was wondering what is the difference between Unary-Operator and Consumer functional interfaces?

Eventually, both of them get a function and apply it to a generic T.

Thank you in advance!


Solution

A Consumer is a method that take a parameter of a generic type T and has no return value (void). A UnaryOperator is a method that take a parameter of a generic type T and return a value of the same type (T).



Answered By - vincendep
Answer Checked By - Willingham (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Older Posts Home
View mobile version

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
All Comments
Atom
All Comments

Copyright © PHPFixing