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...!!!!

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 Tutorials/Questions & Answers:
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
Advertisements
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
java how to get domain name from url
java how to get domain name from url  How to get the domain name from a url string? Example program in java for "how to get domain name from url" Thanks   Hi, You can use the following example code: URL linkURL
Java file get name
Java file get name In this section, you will learn how to get the name... class, you can get the name of any file. Output:ADS_TO_REPLACE_2... the name of the file.ADS_TO_REPLACE_1 Here is the code: import java.io.
Java Get Host Name
Java Get Host Name       In this Example you will learn how to get host name in Java... Name in Java?": Java code to get host nameADS_TO_REPLACE_2
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
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
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
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
How to get the Day name
How to get the Day name  Hi, I am a beginner in Java and new to this web world as well. have a requirement to implement in my assignment project as below: We need to add the days in input date such that it create the date
What is domain name and how to get it?
What is domain name and how to get it?  Hi, I am am searching for the information about the domain name. How to get a domain name for my company... is the unique name given to a website on a server. Example of domain name
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
how to get java path name
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      
SQL get Column Name
SQL get Column Name       SQL get Column Name is used to return the Fieldnames of the table... an example from 'SQL get Column Name'. To understand and elaborate example we
Get Month Name Example
Get Month Name Example     ... in understanding a how to get a 'Get Month Name Example'.For this we have a class name 'GetMonthNameExample'. Inside the main method we declared a String array name
ModuleNotFoundError: No module named 'get-variable-name'
ModuleNotFoundError: No module named 'get-variable-name'  Hi, My... named 'get-variable-name' How to remove the ModuleNotFoundError: No module named 'get-variable-name' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'get-variable-name'
ModuleNotFoundError: No module named 'get-variable-name'  Hi, My... named 'get-variable-name' How to remove the ModuleNotFoundError: No module named 'get-variable-name' error? Thanks   Hi, In your
Get Class Name
Get Class Name       In the example given below we will learn how to get name of the particular class with package name. getName() method returns fully qualified name
how to get selected name from combo box
how to get selected name from combo box   i have fetched all records of worker i.e worker name. on a test.jsp and dispayed it into combo box ...my question is that............. i havt to get particular id of worker on selection
how to get selected name from combo box
how to get selected name from combo box   i have fetched all records of worker i.e worker name. on a test.jsp and dispayed it into combo box ...my question is that............. i havt to get particular id of worker on selection
how to get selected name from combo box
how to get selected name from combo box  i have fetched all records of worker i.e worker name. on a test.jsp and dispayed it into combo box ...my question is that............. i havt to get particular id of worker on selection
how to get selected name from combo box
how to get selected name from combo box  i have fetched all records of worker i.e worker name. on a test.jsp and dispayed it into combo box ...my question is that............. i havt to get particular id of worker on selection
how to get selected name from combo box
how to get selected name from combo box  i have fetched all records of worker i.e worker name. on a test.jsp and dispayed it into combo box ...my question is that............. i havt to get particular id of worker on selection
Get Local Host Name
Get Local Host Name     ... you in understanding a code how to 'Get Local Host Name'. For this we have... the get Display Name ( ) method. 2)getDisplayName ( )   - 
Java example program to get the operating system name of the system
Java example program to get the operating system name of the system       java get Operating... the information about the current operating system name. We can get the current
ModuleNotFoundError: No module named 'middle'
ModuleNotFoundError: No module named 'middle'  Hi, My Python... 'middle' How to remove the ModuleNotFoundError: No module named 'middle'... to install padas library. You can install middle python with following command
sql query to get name,age,phone,address from tables t1,t2,t3,t4,t5 ..
sql query to get name,age,phone,address from tables t1,t2,t3,t4,t5 ..   this is for single table : query ="SELECT name , age , pwd , phone , address FROM t1 order by name"; this is for 2 tables : query ="SELECT t.name
Java class name and file name are different
Java class name and file name are different  Can we run a Java program having class name and file name different?   Hi Friend, No, you can't. It is necessary to save the java file with its class name otherwise
ModuleNotFoundError: No module named 'micral-name-core'
ModuleNotFoundError: No module named 'micral-name-core'  Hi, My... named 'micral-name-core' How to remove the ModuleNotFoundError: No module named 'micral-name-core' error? Thanks   Hi, In your
Java Program MY NAME
Java Program MY NAME   Write a class that displays your first name... with the following name (for example, for letter A, public displayLetterA... in the correct order to display your name
My name, java project
My name, java project  Write a class that displays your first name vertically down the screen ?? where each letter uses up to 5 rows by 5 columns... that letter in a method with the following name (for example, for letter A, public
My name, java project
My name, java project  Write a class that displays your first name vertically down the screen ?? where each letter uses up to 5 rows by 5 columns... that letter in a method with the following name (for example, for letter A, public
ModuleNotFoundError: No module named 'middle-schema'
ModuleNotFoundError: No module named 'middle-schema'  Hi, My... 'middle-schema' How to remove the ModuleNotFoundError: No module named 'middle-schema' error? Thanks   Hi, In your python
get absolute time java
get absolute time java  How to get absolute time in java
need solution to get file name from path which should give by user
need solution to get file name from path which should give by user  how do i write a program in java that i should get file path from arguments.currently this code creates the file at d:\ but i need to get this file name
Get Parameter Name From Servlet Request
having name as firstname, lastname and middle name. We can get values...Get Parameter Name From Servlet Request      ... your First Name, Last Name and Middle Name:</font></b><br><
how to get values for same column name from two different tables in SQL
how to get values for same column name from two different tables in SQL  how to get values for same column name from two different tables in SQL???? column name is emp_id loacated in these two tables company,employee
java get file permission
java get file permission  How to check the get file permission in Java
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
Java example program to get extension
Java example program to get extension       java get extension To get the file name and file extension separately we can do the string manipulation on the file name. Suppose
How to get the unicode of japanese character input in java
How to get the unicode of japanese character input in java  Good Evening sir/madam; I am trying to create an application in java which needs to show the japanese character on frame and need to get the japanese string from
How to get Java SDK
How to get Java SDK  Hi, I have purchased a new computer and installed windows 7. Now I have to get the Java SDK and install on my computer for developing and testing Java programs. So, can anyone tell me How to get Java SDK
Issue with tutorial realted to insertion in middle in Linked List
Issue with tutorial realted to insertion in middle in Linked List  insert in middle in Linked list will take O(N) instead as displayed as O(1
ModuleNotFoundError: No module named 'middle-auth-client'
ModuleNotFoundError: No module named 'middle-auth-client'  Hi, My... named 'middle-auth-client' How to remove the ModuleNotFoundError: No module named 'middle-auth-client' error? Thanks   Hi, In your
NAME SORTING. . .anyone? - Java Beginners
NAME SORTING. . .anyone?  how can I sort names without using the 'name.sort' method? please help. . .anyone? the program should sort the first three(3) letters of the names tnx java masters out there!! (^_^) cVm  Hi
get median in java
get median in java  How to get the median value in Java from the given list.   import java.util.*; class FindMedian { public static int findMedian(int array[]) { int length=array.length; int[] sort = new int[length
Java get System Locale
Java get System Locale       In this section, you will learn how to obtain the locale. We are providing you an example which will obtain the locale of the system
how to use StringTokenizer to retrieve the class name, attributes name and methods name from the Java Source Code
how to use StringTokenizer to retrieve the class name, attributes name and methods name from the Java Source Code  hi, I have done a program whereby it can read a Java file and then tokenize them into tokens. However, I am facing

Ads