How to use a Character in a Switch Statement (Java)

1 Answer

Answer :

answer:Not a java guy so this is just a guess, but it looks like you need to put some quotes around your characters to identify them as strings. Right now I’d guess they’re being treated as variables and not being found. So instead of case a: use case “a”: Also remember case sensitivity with characters…

Related questions

Description : Write a program using switch statement to check whether entered character is VOWEL or CONSONANT

Last Answer : #include<stdio.h> #include<conio.h> void main() { char ch; clrscr(); printf("Enter character:"); scanf("%c",&ch); switch(ch) { case 'a': ... break; default: printf("\n Entered character is CONSONANT"); } getch(); }

Description : In java, ............. can only test for equality, where as ............ can evaluate any type of the Boolean expression. A) switch, if B) if, switch C) if, break D) continue, if

Last Answer : A) switch, if

Description : Which of the following is not the java primitive type A) Byte B) Float C) Character D) Long double

Last Answer : D) Long double

Description : Can anyone coach me through how to use java on my Mac?

Last Answer : answer:You might want to start with Eclipse. This might help too. I haven't played with Java before but you might also need Xcode. It is free. I'm not sure if Eclipse has its own compiler or ... essentially what your instructor has done to you. This isn't high school. You are now a paying customer.

Description : What should I do so that I can learn Java in a fast and efficient manner?

Last Answer : Perhaps you could audit a course. Auditing isn’t as expensive, but you’ll still get the instruction.

Description : Just allowed Java to load on my machine. Is that a mistake?

Last Answer : No, you’re fine. Java is an essential component of many websites, and it’s as safe as houses.

Description : What is hashcode in JAVA..?

Last Answer : answer:

Description : Why would I need Java on my PC?

Last Answer : Some websites and programs use it to run so if you get rid if it you may find somethings don’t work however I haven’t had java on my PC for years and never have any problems.

Description : Does knowing java make learning C/C++/Python easier? Which should I learn first?

Last Answer : answer:Learn Python first if you have no programming experience. The syntax is more human-friendly while still offering the features and speed of compiled languages (like Java and C). With ... speed up the learning process significantly. In what field will you be using your programming knowledge?

Description : How do I run a .jar (java) application on my mac?

Last Answer : I had this problem before, it has something to do with the way JavaSun scripted Java for mac. I would say do a Spotlight for Java and see what comes up, if you don't get an App called Java ... more ideas, but the wrists are starting to hurt and I think I need to call it a night with typing.

Description : Necessary to upgrade JAVA?

Last Answer : It's definitely unnecessary... this last upgrade, if I recall, fixed the daylight savings time (that the US just changed). Regardless, you are probably never using java... and I'm sure the version you have will ... .) But Java truly won't make any difference to you. Don't update if it's a big pain.

Description : For begginers, is Java better than Python?

Last Answer : answer:I don't have any experience with Java, but I can say that Python is the cat's meow. Python is clean and easy to understand, has a zillion libraries you can take advantage of, and has some cool ... have friends who rave about Ruby, but I don't know it well enough to offer an opinion on it.

Description : Using Java Date class...

Last Answer : answer:Date is deprecated because it isn't locale aware. It was replaced with the Calendar family of classes. In order to create & populate an object representing a date in Java you can do something like ... (Calendar.YEAR, 2008); c.set(Calendar.MONTH, Calendar.FEBRUARY); c.set(Calendar.DATE. 19);

Description : What book(s) should I get for learning Java?

Last Answer : Can you clarify one thing before I answer. Are you looking to learn Java or Javascript? There’s a HUGE difference between them, so that’s why I’m asking.

Description : Write java statement to make the Net Fee text field named txtNetFee un_editable at run time. -Technology

Last Answer : txtNetFee.setEditable(false);

Description : Find the output of the following Java code snippet after execution of each java statement labelled -Technology

Last Answer : The output is:IN5inin5

Description : Which of the following statement(s) with regard to an abstract class in JAVA is/are TRUE? I. An abstract class is one that is not used to create objects. II. An abstract class is designed only to act as a base class ... by other classes. (1) Only l (2) Only II (3) Neither I nor II (4) Both l and II

Last Answer : Both l and II

Description : How to switch running X program to use different X server?

Last Answer : Looks like Xvnc may be a good way to do this: http://www.cl.cam.ac.uk/research/dtg/attarchive/vnc/xvnc.html

Description : Can a computer start by itself and switch on the camera?

Last Answer : zenzen If it was asleep and not powered down, then I’m pretty sure the answer is yes.

Description : How can I safely transfer my files and switch from Windows 7 Ultimate RC2 to Ubuntu across 2 hard drives attached to the same motherboard efficiently?

Last Answer : Burn a DVD with the files. Then copy the DVD.

Description : I installed Ubuntu, but how do I switch back to Windows 7?

Last Answer : answer:Umm, if you really installed it in Virtualbox then it can not launch when you start the computer because you would have to run Virtualbox in Windows first to launch Ubuntu. So there are 3 possibilities. 1 ... and then reinstall windows. 1. is the least likely of the 3, 2. is the most likely.

Description : Can you switch the default language of Windows/Microsoft Office's user interface?

Last Answer : answer:How do I get additional language files [in Vista]? With additional language files, you can change the display language on your computer so that you can view wizards, dialog boxes, menus ... Language bar, click Language Bar under Preferences . Loading Korean on my English version of windows 7

Description : How can I change the user agent in Firefox to switch to IE7?

Last Answer : Try this.

Description : How to switch modems?

Last Answer : You don’t, your old modem is dead. Ask us about how to set up your router to require a password. Please list the brand and model number.

Description : Why should my computer switch from Fluther to Outlook by itself from time to time?

Last Answer : Outlook is notoriously jealous.

Description : Is it worth it to switch from Safari to Leopard?

Last Answer : I think you’re confused. Safari is a web browser, Leopard is an operating system. If you took the time to fill out the description portion, I might have been able to help you.

Description : How do I switch all my iTunes stuff onto my new computer?

Last Answer : Um... if your computer is on a home network you can drag your music folder from your old PC to the the music folder on your MAC. That's all that you really have to do. But you have to set up sharing to allow your PC and MAC to share files.

Description : How to i get itunes to stop showing the switch to or retry dialogue box?

Last Answer : answer:firstly run the windows task manager (ctrl alt del),c lcikc on the PROCESSES tab and check to see of the following two processes are in the list -"iTunesHelper" and "qttask.exe" . If they ... /3000-2144_4-10669303.html?tag=lst-0-1) to see of theres a registry error thats causing the problems

Description : Should I stick with installer or switch to app store?

Last Answer : the question is…why leave ? you can just use both.