Describe the ? operator in java langauge, JAVA Programming

Assignment Help:

Describe The ? operator in Java langauge?

The conditional operator just works for assigning a value to a variable, using a value within a method invocation, or in a few other way that indicates the type of its second and third arguments. For instance, consider the subsequent

if (name.equals("Rumplestiltskin")) {
System.out.println("Give back child");
}
else {
System.out.println("Laugh");
}
This may not be written like this:
name.equals("Rumplestiltskin")
? System.out.println("Give back child")
: System.out.println("Laugh");

First of all, both the second and third arguments are void. Other than, no assignment is present to denote the type in which is expected for the second and third arguments (though you know void must be wrong).

The first argument to the conditional operator must have or return Boolean type and the second and third arguments must return values compatible along with the value the whole expression can be expected to return. You could never use a void techniques as an argument to the ? : operator.


Related Discussions:- Describe the ? operator in java langauge

What are the advantages of jms, One of the principal benefits of JMS messag...

One of the principal benefits of JMS messaging is that it's asynchronous. Thus not all the pieces require to be up all the time for the application to function as a whole.

What is meant by universal access of internet services, What is meant by un...

What is meant by universal access of internet services ? the meaning of Universal access of internet services means same functionality to everyone.

Object diagrams, Object diagrams define instances instead of classes. They ...

Object diagrams define instances instead of classes. They are useful for illustrating some complicated objects in detail about their recursive relationships.     When

Simple Program in Java, Write a programme to create a webpage that prints t...

Write a programme to create a webpage that prints the name of the STUDENT database in Wide Latin font and set the subtitle with description of the STUDENT to the screen. Set the pa

Java Project, How to start a java project? how to draw a flow chart?

How to start a java project? how to draw a flow chart?

Create plug-in for adobe after effects, Project Description: We are seek...

Project Description: We are seeking software engineers to create a plug-in for Adobe after Effects (CS4 and above) that allows 3D extrusions for a layer. We are seeking somethin

Overloaded Methods, QUESTION 3: Overloaded methods Write the overloaded me...

QUESTION 3: Overloaded methods Write the overloaded method named average () for each of the following problems: a) The first method receives THREE (3) integer values and returns

Explain the ? operator in java, Explain The ?  operator in Java ? The...

Explain The ?  operator in Java ? The value of a variable frequent depends on whether a particular boolean expression is or is not true and on nothing else. For example one ge

What is bullseye explain with an example, What is Bullseye explain with an ...

What is Bullseye explain with an example? This is a easy applet that draws a series of filled, concentric circles alternating red and white, instead a bullseye. import java.ap

I have javascript work, I have JavaScript work Project Description: I...

I have JavaScript work Project Description: I need an annonation type tool added It should be incredible simple for a good js coder. But there will be a custom design and

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd