Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


poorna chandar rao
Core Java String
1 Answer(s)      3 years and 11 months ago
Posted in : Java Interview Questions


Hi , Here my code

Class Test
{
    String s1 = "null";
    String s2 = "null";
    String s3 = s1+s2;
}

what is the out put


Advertisement
View Answers

November 17, 2010 at 12:12 PM


Hello Friend,

You have written the code wrongly. Its correct way is:

class Test
{
    public static void main(String[] args){
    String s1 = "null";
    String s2 = "null";
    String s3 = s1+s2;
    System.out.println(s3);
    }
}

The above code gives the following output:

nullnull

Thanks



Related Tutorials/Questions & Answers:
Core Java String
Core Java String  Hi , Here my code Class Test { String s1 = "null"; String s2 = "null"; String s3 = s1+s2; } what is the out put
Core Java -String
Core Java -String  Write a program to print "Ranjan pintu am i". the given string is i am pintu ranjan. here there is a condition, we can't use split() method, using loop only
Advertisements
core java
core java  how to display characters stored in array in core java
core java
core java  basic java interview question
CORE JAVA
CORE JAVA  CORE JAVA PPT NEED WITH SOURCE CODE EXPLANATION CAN U ??   Core Java Tutorials
core java
core java  i need core java material   Hello Friend, Please visit the following link: Core Java Thanks
Core java
Core java  difference between the string buffer and string builder
core java
core java  Hi, can any one exain me the concept of static and dynamic loading in core java
core java
core java  Hi, can any one expain me serialization,Deseralization and exterenalization in core java
Core JAva
Core JAva  how to swap 2 variables without temp in java
core java
core java  how can we justify java technology is robust
Core java
Core java  How to use hyperlink that is href tag in core java without swing, frames etc. My code is StringBuffer oBodyStringBuffer = new... string, how to create hyperlink for this state Regards
Core java
Core java  how to convert reverse of String without using String function
core java
core java  how to compare every character in one string with every character in other string
CORE JAVA
CORE JAVA  What is Garbage collection in java? What is the role of a developer for garbage collection
core java
core java  its compulsory to save file name and class name is same in java
Core Java
Core Java  How to execute cmd command through java?? Give Code of them
core java
core java  write a java program to view product details from product table
core java
core java  java program using transient variable   Hi... TransientVariable{ String name; transient String pass; public TransientVariable(String n, String p) { this.name = n; this.pass = p; } public String toString
core java
core java  public class Check { public static void main(String[] args) { System.out.println(11^2); } } how it is work???? plzz explain
Core Java
Core Java  Is Java supports Multiple Inheritance? Then How ?   There is typo the question is , What is Marker Interface and where it can... implements markerImp{ } public class TestInstanceOf { public static void main(String
CORE JAVA
CORE JAVA  Iā??ve a string like below String xyz =ā??nullā??; I want to compare xyz with space which is in other String ABC. What will be the output
core java
core java  public static void main(String k[]) Is it possible to pass the Integer type arr instead of String type in main method?(replacing String than Integer) if possible.. how to write code
Core Java
Core Java  Hi, Can any one please share the code for Binary search in java without using builtin function
Core Java
Core Java  Please write a Java Program to design login form and store the values in file & validate and display the MainForm
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
core java  Hello sir,What is logic behinde the core java programms,How may programmas are there,for example,sorting of two numbers,grade of the student details,fibonice serice,paldroma,incremting of the program,asscedding
core java
core java  Hello sir,What is logic behinde the core java programms,How may programmas are there,for example,sorting of two numbers,grade of the student details,fibonice serice,paldroma,incremting of the program,asscedding
Core Java
Core Java  Hi, can any one please tell me the uses of return type,"Super" and "this" calling statement in Java?? why do we required this,super calling statement?? why return type is required
Core Java
Core Java  Hi, Can any one please expain me why derived data types are required in java as we have primitive data types with us
Core Java
Core Java  Hi, Can any one please expain me why derived data types are required in java as we have primitive data types with us
Advertisements
 

 

 

DMCA.com