printStackTrace methods are used to print a stack trace
TotalMemory() returns the total number of bytes of memory available to the program
Can we have a private constructor in Java?
How can an object be unreferenced?
What is the relationship called where a child object gets killed if the parent object is killed?
if the constructor of class A is made private then Objects of class A can be instantiated only within the class where it is declared
public class output{
public static void main(String args[]){
int a=10;
int b=20;
int sum=0;
sum= ++a + ++b;
System.out.println(sum);
}
}
public class abekus
{
public static void main(String[] args) {
float a = 90.0f;
String temp = Float.toString(a);
System.out.println(temp);
}
}
What will be the correct output?
public class Main {
int x=9;
public void add(int i)
{
System.out.println("integer value passed.");
}
public void add(float i)
{
System.out.println("float value passed.");
}
public static void main(String[] args) {
Main m=new Main();
m.add(10.4f);
}
}
Which of the following statements about Java is false?