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 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 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 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 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
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 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 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
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
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
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      
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
how to get java path 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 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
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
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 '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
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
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
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
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
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
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
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
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
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
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
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
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 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
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
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
Remote System OS name in JAVA - JSP-Servlet
Remote System OS name in JAVA  I need to print the different os names of the all computers in my local network. I know that with System.getProperty("os.name"), I get the os name of my computer but for the other computers, I have
why java file save as its class name
why java file save as its class name  hi,this is subbareddy vajrala.my doubt is why java files save as its class names
connect database without specifying dsn name in java
connect database without specifying dsn name in java  How can i connect the database with my application without specifying the dsn name by using jdbc & odbc..... i have saw this code on the web-site try
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
Constructing a File Name path in Java
Constructing a File Name path        In Java, it is possible to set dynamic path, which is helpful for mapping local  file name with the actual path of the file using
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

Ads