Professional Documents
Culture Documents
a. Array
b. Stack
c. String
d. Integer
Basic I/O
class Test
{
public static void main(String[] args)
{
for(int i = 0; 1; i++) Output: Error
{
System.out.println("Hello");
break;
}
}
}
Basic I/O
Can command line arguments be converted into int automatically if required?
a. Yes
b. No
c. Compiler dependent
d. Only ASCII can be converted
Basic I/O
Which is the correct declaration of a boolean variable?
a. boolean check=‘false’;
b. boolean check=0;
c. boolean check=“false”
d. boolean check=false
Basic I/O
Write a program to get a input from user and print it using command
line arguments
Basic I/O
What is the output of this program, Command line execution is done
as “java output This is a command Line”?
class Output
{
public static void main(String args[])
{ Output: This
System.out.print(args[0]);
}
}
Basic I/O
What is the output of this program, Command line execution is done
as “java output This is a command Line”?
class Output
{
public static void main(String args[])
{ Output: command
System.out.print(args[3]);
}
}
Basic I/O
What is the output of this program, Command line execution is done
as “java output This is a command Line”?
class Output
{
public static void main(String args[])
{ Output:
System.out.print(args);
java.lang.String;@3c679bde
}
}
Basic I/O
Write a program to get a input from user add 2 numbers and print the
result using command line arguments
Basic I/O
What is the output of this program
Write a program to get a input from user and swap 2 numbers using
command line arguments
Basic I/O
Write a program to get a input from user and swap 2 numbers without
using third variable using command line arguments
Basic I/O
What are the I/O streams Java programming language?