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

Explain how many ways businesses monitor their employees, Explain how many ...

Explain how many ways businesses monitor their employees? • Systems are available which monitor almost every key stroke that an employee forms on a computer. • Systems are avai

What is the jsf, JavaServer Faces(JSF) is a framework for building web-base...

JavaServer Faces(JSF) is a framework for building web-based user interface in Java. Unlike Swing, JSF provides widgets like buttons, hyperlinks, checkboxes, etc. in dissimilar ways

Three ways in which a thread can enter the waiting state, What are three wa...

What are three ways in which a thread can enter the waiting state ?

Explain arithmetic promotion and binary operations, Explain Arithmetic Prom...

Explain Arithmetic Promotion and Binary Operations? An int divided through an int is an int, and a double divided by a double is a double, but what about an int divided by a do

Develop a camera application, Project Description: I want to build a cam...

Project Description: I want to build a camera application for android. By default android will add metadata for the image, for e.g.  Date, time, resolution, gps tag etc..In this

Jsf framework compare with the struts framework, Struts framework ...

Struts framework                            J a v a Server Faces More matured since Struts has been started for a few years. It has got var

Problem D., In Exercise 1 you were asked to modify the Sorts program so tha...

In Exercise 1 you were asked to modify the Sorts program so that it would output the number of swaps used by a sorting method. It is a little more difficult to have the program als

Smugglers decodes , Smugglers are becoming very smart day by day. Now they ...

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

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

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