Java and Systems Programming Quiz
Test your knowledge of Java programming, Unix/Linux systems programming, and Windows/.NET development concepts
Questions
how can we provide authetication in Windows Service, So that it will not ask for user credentials at the time of installation
- By reading context values from command prompt
- By hard coding the user credentials in Windows Service file
- both are correct
- both are incorrect
Which contract is used in WCF Service for Exceptions
- Message Contract
- Exception Contract
- Fault COntract
- None of the above
Which of the following statements is incorrect for MVC
- MVC Framework and MVC Pattern are same
- in MVC the flow of execution is determined by controller
- Routing is used to redirect user to specific page
- Model corresponds Database, View corresponds User Interface and Controller handles
how can we provide authetication in Windows Service, So that it will not ask for user credentials at the time of installation
- By reading context values ( User Authentication Details) from command prompt
- By hard coding the user credentials in Windows Service file
- both are correct
- both are incorrect
Which contract is used in WCF Service for Exceptions
- Message Contract
- Exception Contract
- Fault COntract
- None of the above
class A { public void main(String args[]) { System.out.println("Hello World!"); } } What is the output of the program?
- Hello World!
- "Hello World!"
- Compilation Fails
- Runtime Exception
Consider this as a part of a code which has no compilation errors or runtime exceptions 21.Integer i1=1000; 22.Integer i2=1000; 23.System.out.println(i1==i2); what is the output?
- true
- false
- compilation fails at line 21
- compilation fails at line 22
class A { public static void main(String args[]) { System.out.println(args.length); } } what is the output if the code is run using command line invocation java A
- NullPointerException
- Compilation fails
- 0
- 1
int[] a,b[] and int a[],b[] are same??
- True
- False
Which one of these are JVM thrown exceptions??
- NullPointerException
- NumberFormatException
- ExceptionInInitializerError
- IllegalArgumentException
Which one of these are true regarding inheritance in java??
- A class can extend multiple classes
- An interface can extend multiple classes
- An interface can implement multiple interfaces
- A class can extend multiple interfaces
- A class can implement multiple interfaces
- An interface can extend multiple interfaces
Given a part of code tell the output(Assume that the code is perfect ie no compiler error or runtime exceptions) Pattern p=Pattern.compile("\d+"); Matcher m=p.matcher("345678"); while(m.find()) { System.out.print("-"+m.group()+"-"); }
- -345678-
- -3--4--5--6--7--8-
- -3--34--345--3456--34567--345678-
- -345678--345678--345678--345678--345678--345678--345678-
Consider the following code snippet String s1="Hello"; String s2=s1; s1.concat("World"); System.out.println(s1+"---"+s2); What is the output??
- Hello---Hello
- Hello---HelloWorld
- HelloWorld---Hello
- HelloWorld---HelloWorld
Which one of these are legal combinations when used with a method??
- abstract final
- abstract static
- static final
- private abstract
class A { public void add(int,int) { System.out.println("Normal"); } public void add(int... a) { System.out.println("Varargs"); } public static void main(String... args) { new A().add(9,9); } } what is the output??
- Varargs
- Normal
- Compilation Fails
- Runtime Exception
Inode contains the following fields?
- File owner and File type
- File access permission and File access tie
- Number of Links, File size and Location of the file data
- All of the above
In a crontab the job to be executed is scheduled as follows . 10 06 * 8 6 Job to be scheduled Which of the following statement is true?
- Command will be executed on every Sunday in 06:10 in September
- Command will be executed on every Saturday at 10:06 in August
- Command will be executed on every Sunday at 10:06 in September
- Command will be executed on every Saturday at 6:10 in August
How can I forward all the arguments given to my script to another command? Here Command is the name of the command to be execute.
- Command “@$”
- command \${@:+"\$@"}
- command \${"\$@+@:”}
- Command “$?”
The fork() system call is used for the following process management
- To increase/decrease the data segment size of a process
- To create a new process
- To bias the existing priority of a process
- To get parent process identifier