Monthly Archives: October 2019

Java questions – Part 5

1 What is the output of below code snippet?

Options: A. “123451234512345” B. Prints a negative integer value C. “12345100000” D. Compilation error 2. Given the following definitions, which of these expressions will NOT evaluate to true?

Options: A. b1 | !b2 B. (i1 ^ 12) < 4 C. i2 & b1 D.… Read More »

java program to find largest number in an array

Java program to find largest number in an array: In this article, you are going to learn how to find the largest number in an array in java by giving the input elements from the keyboard. Method 1: Using Arrays.sort() method

Output: largest number in array is: 45 Method 2: 1 Accept 10 numbers… Read More »

java files

File class is present in java.io package and we can work with File class to read or write data.

Below are the methods present in File class. Method Type Description length() String Returns the length of the file. canRead() Boolean Tests whether the file is readable or not. canWrite() Boolean Tests whether the file… Read More »