Which of these methods can set the output stream to OutputStream?
The built-in base class in Java, which is used to handle all exceptions, is:
variables of interface should be
The class support one default constructor stack() which is used to
class test{
public static void main (String[] args) {
int x=10,y=15;
if(x++<10 || ~y<15)
{
x--;
}
else
{
y--;
}
System.out.println(x+" "+(++y));
}
}
public class outputs
{
public static void main(String args[])
{
int a=10;
int b=20;
int c=30;
int sum=0;
sum= ++a + ++b + ++b*c + ++a*c ;
System.out.println(sum);
}
}
What will be the output of the following Java code?
class Output
{
public static void main(String[] args)
{
String c = "Hello i love java";
int start = 2;
int end = 9;
char[] s = new char[end - start];
c.getChars(start, end, s, 0);
System.out.println(new String(s));
}
}
class first
{
int a;
void show()
{
System.out.println(a);
}
}
class second extends first
{
int b;
void show()
{
System.out.println(b);
}
}
class output
{
public static void main(String args[])
{
second obj = new second();
obj.a=1;
obj.b=2;
obj.show();
}
}
import java.util.*;
public class outputs
{
public static void main(String args[])
{
LinkedList list = new LinkedList();
list.add(new Integer(3));
list.add(new Integer(9));
list.add(new Integer(5));
list.add(new Integer(1));
list.addFirst(new Integer(6));
list.addLast(new Integer(9));
Iterator i = list.iterator();
Collections.sort(list);
while(i.hasNext())
System.out.print(i.next() + " ");
}
}
class Father{
void run(){
System.out.println("father start running");
}
void walk(){
System.out.println("father start walking");
}
}
class Child extends Father{
@Override
void run(){
System.out.println("child start running");
}
void walk(){
System.out.println("child start walking");
}
void sleep(){
System.out.println("child start sleep");
}
}
public class main {
public static void main(String args[]){
Father f1=new Father();
Child c1= new Child();
c1.run();
f1.walk();
}
}
OnSite
1 Openings
FullTime
Posted 17 days ago