-
-
Memory Allocation
What is the difference between below 2 statements?
String s1=new String("abc");String s2="abc";How it will allocate in memory? -
-
-
-
-
More than One Class
If more than one class is present in one Java file then what will be the java file name?
-
Synchronization in Java
When We should use Synchronization in Java and when we should not?
-
-
Overriding Methods
Suppose a Super Class method throws an exception and this method is Overriden in the subclass with no exception. Now if you create a super class reference that has a subclass object. This throws a compile time error, Why?
-
If there are more than one main method in a program, then which main method will be called.
what will be the output
class A
{
public static void main(String args[])
{
System.out.println("Hi friend");
}
}
class Test
{
public static void main(String args[])
{
System.out.println(" How are you");
}
}
-
-
-
-
-
-
Find the Output
class A{ public static void main(String[] a){ System.out.print(String.valueOf(1)+String.valueOf(2)); String s1="s1"; String s2=s1.toString(); System.out.print(","+(s1==s2)); }}
-
-
-
Core Java Interview Questions
Ans