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

A new dynamic website, A NEW Dynamic Website I have the subsequent requi...

A NEW Dynamic Website I have the subsequent requirement which needs to be designed in 30 days (Max). 1) Construct a website which is a dynamic, means allow me to change conte

In javascript what is event handling and inline event, In JavaScript, what ...

In JavaScript, what is event handling? What are the two categories of events? In java script we could capture events on do a few operation on the basis of which particular even

Loops, Use a while loop to count down from 100 and display all the numbers ...

Use a while loop to count down from 100 and display all the numbers in the * following pattern (you have to figure out what the pattern is - don''t go below 0): * 100 99 97 94

Web-based client program, Why are JSP pages the preferred API for creating ...

Why are JSP pages the preferred API for creating a web-based client program? Because no plug-ins or security policy files are required on the client systems (applet does). Also,

What are the role of keywords in java, What are the role of Keywords in jav...

What are the role of Keywords in java? Keywords are identifiers such as public, static and class in which have a special meaning inside Java source code and outside of comments

Need software protection with data files encryption, Need Software protecti...

Need Software protection with data files encryption Project Description: I am use to Chinese dongle sense lock clave 2, i need to prepare to dongle encryption tool same appli

I need liferay especialist, I need Liferay Especialist Project Descripti...

I need Liferay Especialist Project Description: We want a JAVA + JSF + Portlets expert Liferay expertise is needed Big Data and Online Tools + Multilingual Portal & Websit

Differentiate between primitives and objects, Differentiate between Primiti...

Differentiate between Primitives and Objects Everything in Java is an "Object", as every class by default inherits from class "Object", except a few primitive data t

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