Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. JAVA program to check please answer

JAVA program to check please answer

Scheduled Pinned Locked Moved Java
java
15 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vivek886
    wrote on last edited by
    #1

    Simple Java program to check whether input value is numeric or alphabet. If alphabet check whether its Capital or or lowwer case. If digit throw user defined exception " Digit not allowed."

    D L L 3 Replies Last reply
    0
    • V vivek886

      Simple Java program to check whether input value is numeric or alphabet. If alphabet check whether its Capital or or lowwer case. If digit throw user defined exception " Digit not allowed."

      D Offline
      D Offline
      Dr Walt Fair PE
      wrote on last edited by
      #2

      vivek886 wrote:

      Simple

      Yep. So, what did you try?

      CQ de W5ALT

      Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software

      V 1 Reply Last reply
      0
      • V vivek886

        Simple Java program to check whether input value is numeric or alphabet. If alphabet check whether its Capital or or lowwer case. If digit throw user defined exception " Digit not allowed."

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        vivek886 wrote:

        Simple

        Do you mean that you could code this with your eyes closed, or you are throwing down a challenge to the rest of us?

        Just say 'NO' to evaluated arguments for diadic functions! Ash

        V 1 Reply Last reply
        0
        • V vivek886

          Simple Java program to check whether input value is numeric or alphabet. If alphabet check whether its Capital or or lowwer case. If digit throw user defined exception " Digit not allowed."

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          Yes, that is simple. So much so it would be insulting if we offered any help you did not ask for. :)

          Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

          Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

          V 1 Reply Last reply
          0
          • L Luc Pattyn

            Yes, that is simple. So much so it would be insulting if we offered any help you did not ask for. :)

            Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

            Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

            V Offline
            V Offline
            vivek886
            wrote on last edited by
            #5

            I mean to say that m asking for the solution as m new to java. and m sorry the way i asked question . Actually the question is write simple program.

            N 1 Reply Last reply
            0
            • D Dr Walt Fair PE

              vivek886 wrote:

              Simple

              Yep. So, what did you try?

              CQ de W5ALT

              Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software

              V Offline
              V Offline
              vivek886
              wrote on last edited by
              #6

              Actually i was asking the question Q. Write a simple Java program to check whether input value is numeric or alphabet. If alphabet check whether its Capital or or lowwer case. If digit throw user defined exception " Digit not allowed." Actually m new this forum and New to java. Can you please tell me the solution. will be thank full to you. Can this program be written in command line form? Means if we run it from a command prompt. or in AWT only.? Sorry if any mistake from my side.

              1 Reply Last reply
              0
              • L Lost User

                vivek886 wrote:

                Simple

                Do you mean that you could code this with your eyes closed, or you are throwing down a challenge to the rest of us?

                Just say 'NO' to evaluated arguments for diadic functions! Ash

                V Offline
                V Offline
                vivek886
                wrote on last edited by
                #7

                Actually i was asking the question Q. Write a simple Java program to check whether input value is numeric or alphabet. If alphabet check whether its Capital or or lowwer case. If digit throw user defined exception " Digit not allowed." Actually m new this forum and New to java. Can you please tell me the solution. will be thank full to you. Can this program be written in command line form? Means if we run it from a command prompt. or in AWT only.?

                L 1 Reply Last reply
                0
                • V vivek886

                  Actually i was asking the question Q. Write a simple Java program to check whether input value is numeric or alphabet. If alphabet check whether its Capital or or lowwer case. If digit throw user defined exception " Digit not allowed." Actually m new this forum and New to java. Can you please tell me the solution. will be thank full to you. Can this program be written in command line form? Means if we run it from a command prompt. or in AWT only.?

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  vivek886 wrote:

                  Can you please tell me the solution.

                  Unfortunately no, you need to work it out for yourself. If you are new to Java then I suggest you spend time working through these tutorials[^]. There is a high probability that you will find the answer quite easily.

                  Just say 'NO' to evaluated arguments for diadic functions! Ash

                  V 2 Replies Last reply
                  0
                  • V vivek886

                    I mean to say that m asking for the solution as m new to java. and m sorry the way i asked question . Actually the question is write simple program.

                    N Offline
                    N Offline
                    Nagy Vilmos
                    wrote on last edited by
                    #9

                    If you haven't guessed, no one will write your code, but we'll help you make it right.


                    Panic, Chaos, Destruction. My work here is done. or "Drink. Get drunk. Fall over." - P O'H

                    1 Reply Last reply
                    0
                    • L Lost User

                      vivek886 wrote:

                      Can you please tell me the solution.

                      Unfortunately no, you need to work it out for yourself. If you are new to Java then I suggest you spend time working through these tutorials[^]. There is a high probability that you will find the answer quite easily.

                      Just say 'NO' to evaluated arguments for diadic functions! Ash

                      V Offline
                      V Offline
                      vivek886
                      wrote on last edited by
                      #10

                      ok then please tell me how to check a string! in Java.

                      T 1 Reply Last reply
                      0
                      • V vivek886

                        ok then please tell me how to check a string! in Java.

                        T Offline
                        T Offline
                        TorstenH
                        wrote on last edited by
                        #11

                        OK, that's much better. This is a question we are willing to answer. If alphabet check whether its Capital or or lowwer case check this: java.lang.String @ oracle.com and - as you want to find capital letters check this ASCII-Table the "HTML" and the "chr" columns are quite interesting when combined with java.lang.Character @ oracle.com If digit throw user defined exception " Digit not allowed." check this: Try Catch Tutorial @ oracle.com and find a way to convert a String into a java.lang.Integer @ oracle.com ;) regards Torsten

                        I never finish anyth...

                        1 Reply Last reply
                        0
                        • L Lost User

                          vivek886 wrote:

                          Can you please tell me the solution.

                          Unfortunately no, you need to work it out for yourself. If you are new to Java then I suggest you spend time working through these tutorials[^]. There is a high probability that you will find the answer quite easily.

                          Just say 'NO' to evaluated arguments for diadic functions! Ash

                          V Offline
                          V Offline
                          vivek886
                          wrote on last edited by
                          #12

                          is this program right to check whether string is alpha or numeric public boolean isIntNumber(String num){ try{ Integer.parseInt(num); } catch (NumberFormatException nfe) { return false; } return true; }

                          L T D 3 Replies Last reply
                          0
                          • V vivek886

                            is this program right to check whether string is alpha or numeric public boolean isIntNumber(String num){ try{ Integer.parseInt(num); } catch (NumberFormatException nfe) { return false; } return true; }

                            L Offline
                            L Offline
                            Lost User
                            wrote on last edited by
                            #13

                            Well it's certainly one of doing it. What happens when you run this code passing in a string, number, null etc.?

                            Just say 'NO' to evaluated arguments for diadic functions! Ash

                            1 Reply Last reply
                            0
                            • V vivek886

                              is this program right to check whether string is alpha or numeric public boolean isIntNumber(String num){ try{ Integer.parseInt(num); } catch (NumberFormatException nfe) { return false; } return true; }

                              T Offline
                              T Offline
                              TorstenH
                              wrote on last edited by
                              #14

                              well, it is just one method - not a complete program - but it will do what it is suposed to do. regards Torsten

                              I never finish anyth...

                              1 Reply Last reply
                              0
                              • V vivek886

                                is this program right to check whether string is alpha or numeric public boolean isIntNumber(String num){ try{ Integer.parseInt(num); } catch (NumberFormatException nfe) { return false; } return true; }

                                D Offline
                                D Offline
                                David Crow
                                wrote on last edited by
                                #15

                                vivek886 wrote:

                                is this program right to check whether string is alpha or numeric

                                Technically, yes, but using exceptions in such a fashion could be costly.

                                "One man's wage rise is another man's price increase." - Harold Wilson

                                "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                                "Man who follows car will be exhausted." - Confucius

                                1 Reply Last reply
                                0
                                Reply
                                • Reply as topic
                                Log in to reply
                                • Oldest to Newest
                                • Newest to Oldest
                                • Most Votes


                                • Login

                                • Don't have an account? Register

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • World
                                • Users
                                • Groups