In abstract class, we can't create a constructor
In java arrays are represented as
In which file is the database table configuration stored?
int search(object element) is determine whether element exists in the stack
We can convert an Array to ArrayList using which method?
class test{
public static void main (String[] args) {
int i=32768;
short s=(short)i;
byte b=(byte)i;
System.out.println(b+" "+s);
}
}
What is the output of this program?
class StringDemo
{
public static void main(String args[])
{
int ascii[] = { 65, 66, 67, 68};
String str = new String(ascii, 1, 3);
System.out.println(str);
}
}
Predict the output of the following Java code:
import java.lang.*; class Counter { int count; public void increment() { count++; }}
public class Main { public static void main(String args[]) throws Exception { Counter c=new Counter(); Thread t1 =new Thread (new Runnable() { public void run() { for(int i=1;i<=1000;i++) { c.increment(); }} }); t1.start(); t1.join(); System.out.println(c.count); }}
class method
{
static int i;
static int j;
void add(int a , int b)
{
i =j + b;
j =i + b;
}
}
class output
{
public static void main(String args[])
{
method obj1 = new method();
method obj2 = new method();
int a = 5;
obj1.add(a, a+1);
obj2.add(6, a);
System.out.println(obj1.i+" "+obj2.j);
}
}