Home Answers Viewqa Java-Beginners CORE JAVA get middle name

 
 


Ankit Kumar
CORE JAVA get middle name
1 Answer(s)      a year ago
Posted in : Java Beginners

hello sir...how to get middle name using string tokenizer....??? eg..like name ANKIT it will select only K...!!!!

View Answers

June 14, 2012 at 1:28 PM


The given code accepts the name from the console and find the middle character from the name.

import java.util.*;

class GetMiddleCharacter
{
    public static void main(String[] args) 
    {
        Scanner input=new Scanner(System.in);
        System.out.print("Enter Name: ");
        String str=input.nextLine();
        int len=str.length();
        int c=len/2;
        char ch[]=str.toCharArray();
        System.out.println("Middle Character is: "+ch[c]);
    }
}









Related Pages:
CORE JAVA get middle name
CORE JAVA get middle name  hello sir...how to get middle name using string tokenizer....??? eg..like name ANKIT it will select only K...!!!!   The given code accepts the name from the console and find the middle
Java get middle character
Java get middle character In this tutorial, you will learn how to get middle character from the word. Here is an example of getting the middle letter of the word entered by the user using Java. If you have a word string 'company
core java
core java  hello sir....i have one table in which i have 3 columns First Name,Middle Name,Last Name...............but i have to show single name... Name-Ranvir Middle Name-Kumar Last Name-Kapoor i have to print Ranvir Kumar
CORE JAVA
CORE JAVA  Q)How to sort a Hash Table, if you pass an Employee Class Object in that First Name, Last Name, Middle Name based on last name how you sorting the Employee Class? Q)How to display the list variables in reverse
Java file get name
Java file get name In this section, you will learn how to get the name... get the name of any file. Output: File name is: out.txt... the name of the file. Here is the code: import java.io.*; public class
Get computer name in java
Get computer name in java       We can get the computer name by the java code program. For getting computer name we have used java.net.InetAddress class. We will use static
core java
core java  its compulsory to save file name and class name is same in java
Get Property by Name
to get Property by Name. For this we have a class name "Get Property... .style1 { margin-right: 75px; } Get Property by Name      
core java
core java  In java primitive variables will get its default value automatically after declaration. Then why it is mandatory to initialize a variable before using
core java - Java Beginners
core java  i want to get java projects in core java
Java Get Host Name
Java Get Host Name       In this Example you will learn how to get host name in Java. Go through...; Java code to get host name import java.net.
Java Get File Name
Java Get File Name       In this section, you will study how to obtain the name of file.  In order to get the file name, we have provided the path of file 'Hello.txt
core java
core java  java program using transient variable   Hi... TransientVariable{ String name; transient String pass; public TransientVariable(String...() { return "Name=" + name + "\n Password=" + pass; } public static void main(String
core java
core java  Dear Friends, I am new to java and i faced one program.Can... a b c d a b c d e a b c d e f a b c d e a b c d a b c a b a how can we get... new to java and i faced one program.Can any one just help me getting output
Core Java
Core Java  Q. A producer thread is continuously producing integers... by the producer, the method "get( )" is invoked by through the "Consumer" class which... val; boolean value = false; synchronized int get() { if(!value) try { wait
Java example to get Object class name at runtime
Java example to get Object class name at runtime       java get Object class name In java there is a way that makes us enabled to get the object class name at runtime. It can
Name
Name  make a program that take a input from user in alphabet and show all the name of that character E.g User give character "B". The program shows all the human names which starts from B.   Java show all names
How to get month name from date(like-25/06/2012) using java?
How to get month name from date(like-25/06/2012) using java?  How to get month name from date(like-25/06/2012) using java
Get Parameter Name From Servlet Request
having name as firstname, lastname and middle name. We can get values...Get Parameter Name From Servlet Request      ..., Last Name and Middle Name:</font></b><br><br>
Java program to get domain name by URL
Java program to get domain name by URL       We can also get the domain name by the java... of numerical internet address.  In our this example to get the domain name we
core java - Java Beginners
core java  when write java program in editplus.then save&compile the file. 1-text file 2-class file 3-bak file how can get this files plz tell me  Hi Friend, Please clarify your problem. Thanks
core
core  where an multythread using   Please go through the following link: Java Multithreading
core java - Java Beginners
core java  hi, what is the difference between method... means class to have two or more methods with same name in the but with the different... and Overriding: http://www.roseindia.net/java/javascript-array/modified-java-method
Core java Basic
Core java Basic  How to compile a program using the package statement at the first line.Do I have to create a a Seperate Folder with the name of the package in my directory.Please tell me the steps
Java program to get class name without package
Java program to get class name without package ... example which describes you that how you can get the class name without package.... As a result we will finally get the class name without package.  In this code
Core Java - Java Beginners
Core Java  How can I take input?  hai.... u can take input... { System.out.println("Whats the name,please?"); BufferedReader br=new BufferedReader(new... information : http://www.roseindia.net/java/ Thanks
core java - Java Beginners
core java  how to reverse a the words in the sentence for example ( this is my name -should be changed to as- name my is this  hello friend...://www.roseindia.net/java/ Thanks & Regards Amardeep
core java-file
core java-file  hi, i want to create a file name simple.txt using command promt and also i want to insert a 36 numbers in a file using command prompt only and then i want to make that data in the form two data in a bracket lke
core Java programming
core Java programming  Hi, Thanks for ur previous answers.... I...;TIME:HHMMSS;ITEM1:QTY:PRICE;ITEM2:PRICE2;] They are looking for a Java Program... date in the format DATE CUST_NAME ITEM QTY PRICE
core java - Development process
core java  Hi i want core java code for this problem.its urgent... get a complete view of the surrounding terrain to send back to Earth. A rover's... visit to : http://www.roseindia.net/java/ Thanks
core java programming question
core java programming question  How to write a java program to list... i=1;i<=10;i++){ System.out.print("Enter Customer Name: "); String name=input.nextLine(); System.out.print("Enter Date(yyyy-mm-dd
core java - Development process
core java  Hi i want core java code for this problem.its urgent... a receipt which lists the name of all the items and their price (including tax... to : http://www.roseindia.net/java/ Thanks
Combine Name
! Enhance the program to handle a middle name. Produce a combined name of the form last name, comma, space, first name, comma, space, middle initial, period... Java: Example - CombineName The following program has two text fields, one
core java - Applet
core java  how can draw a single line with mouse in applet. please... the applet with html file: Java Applet Demo Put your html file... applet will get start. Then you can draw the line with mouse on it. Thanks
core java - Applet
core java   Namaste sir , how can draw a line in Applet. I want when I press mouse button and moves any way then show the line . i, working... Line using mouse Thanks    The applet name
core java - Java Interview Questions
core java  why sun soft people introduced wrapper classes? do we... types. Wrapper classes also provides many utility methods. So, in order to get... links: http://www.roseindia.net/java/wrapper-class/ Thanks
core java
core java  how to display characters stored in array in core java
Core Java Topics
Core Java Topics Following are the topics, which are covered under Core Java. In the roseindia website for core java, programmer will find completed details of every core java topic and simple example of core java that will help you learn
core java
core java  basic java interview question
Core Java Programming - Java Beginners
Core Java Programming  Write a program in Java which initializes the starting date as your birthday and displays the date 90 days later in the format day name, month name, day, year   Hi friend, Code to solve
Core Java Interview Question, Interview Question
Core Java Interview Question Page 23  ... is a Java package and how is it used? A Java package is a naming context for classes and interfaces. A package is used to create a separate name space for groups
Core Java Programming - Java Beginners
Core Java Programming  Write a program in Java which generates a random number between 0 and 1. If the number generated is less than 0.5... than 0.5" : "The value is greater than 0.5"; // get absolute value of i
core java
core java  i need core java material   Hello Friend, Please visit the following link: Core Java Thanks
CORE JAVA
CORE JAVA  CORE JAVA PPT NEED WITH SOURCE CODE EXPLANATION CAN U ??   Core Java Tutorials
Core Java
Core Java  what is a class
core java - Java Interview Questions
core java - Use of polymorphism in object oriented programming   Hi... of multiple methods having the same method name. Java code uses a late-binding... languages .In java it states using of one single interface with a set of actions
core java
core java  Hi, can any one expain me serialization,Deseralization and exterenalization in core java
core java
core java  Hi, can any one exain me the concept of static and dynamic loading in core java
core java - Java Interview Questions
core java  What is the purpose of the System class? what.... The function name is assigned to the setInitialSpeed property of the Car class...; } ----------------------------------------- Read for more information. http://www.roseindia.net/java