• Result
  • Today's Puzzle
    • Previous Puzzles
    • Prize & Rules
  • Discussion Board
    • Suggestion Board
    • Trending Articles
  • Maths Tricks
  • Placement Papers
    • Placement Questions
    • Interview Experience
    • Placed user Comment
    • Group Discussion
  • English APP
  • login
  • Result
  • Today's Puzzle
    • Previous Puzzles
    • Prize & Rules
  • Discussion Board
    • Suggestion Board
    • Trending Articles
  • Maths Tricks
  • Placement Papers
    • Placement Questions
    • Interview Experience
    • Placed user Comment
    • Group Discussion
  • Walkins
    • Corporate Job Exam
    • Government Job Exam
    • Entrance Exam
  • Training
    • Internship
  • Placement Questions
  • /
  • Java

Java interview questions and answers for freshers Page 5

Java Select Another Category Select Another Topic

Programming and Technical

  • Android 118
  • ASP.NET 60
  • C 459
  • C++ 448
  • DATA STRUCTURE 66
  • DBMS 77
  • ELECTRONICS 39
  • Java 261
  • OOPs Concepts 117
  • Operating Syst 103
  • RDBMS 109
  • UNIX 70

Java Question Topics

    Category (1)

    General Ability (3)

  • General Knowledge (3)
  • HR Interview (3)

  • Interview (3)
  • Logical Reasoning (5)

  • Blood Relations (1)
  • Coding Decoding (2)
  • Cryptography (1)
  • Seating Arrangement (1)
  • Numerical Ability (4)

  • Algebra (1)
  • Number System (1)
  • Profit and Loss (1)
  • Programming (124)

  • Arrays (7)
  • Basics (5)
  • Database (4)
  • Definition (25)
  • Functions (3)
  • Output (4)
  • Program (20)
  • Puzzles (1)
  • Technical (43)
  • Verbal Ability (1)

  • Miscellaneous (1)
Keep an EYE (0)
Solved Question (3) UnSolved Question (258)
Pages: 27FirstPrev123456789NextLast
Advertisements

(#M40156025) JAVA QUESTION java Keep an EYE Keep an eye puzzle Keep an eye puzzle

how can we print a statement in java with out main method in the java 7 version

Asked In Java PRABHANJAN (9 years ago)
Unsolved Read Solution (12)
Is this Puzzle helpful?   (14)   (4) Submit Your Solution Arrays

(#M40155917) JAVA QUESTION The Difference between == operator and equals() method? Keep an EYE Keep an eye puzzle Keep an eye puzzle

Which is the correct option for comparing the contents of 2 String objects?
[1] == operator
[2] equals() method
[3] Both

Asked In Java Rishikesh Agrawani (9 years ago)
Unsolved Read Solution (34)
Is this Puzzle helpful?   (27)   (5) Submit Your Solution Functions
Advertisements

(#M40155912) JAVA QUESTION String Keep an EYE Keep an eye puzzle Keep an eye puzzle

Can we create a String object by using an array of characters?
[1] If Yes, then how?
[2] If No, then why?

Asked In Java Rishikesh Agrawani (9 years ago)
Unsolved Read Solution (5)
Is this Puzzle helpful?   (15)   (2) Submit Your Solution Arrays

(#M40155163) JAVA QUESTION General awareness Question On Class and objects Related? Keep an EYE Keep an eye puzzle Keep an eye puzzle

Have You Seen A "Tree"??
a)Yes b)No
The above question is related to class and Object....If you say Yes/No....please Submit your reason also

Asked In Java Ravi teja (9 years ago)
Unsolved Read Solution (4)
Is this Puzzle helpful?   (30)   (8) Submit Your Solution General Knowledge

(#M40154942) JAVA QUESTION coding Keep an EYE Keep an eye puzzle Keep an eye puzzle

Write a function that accepts a sentence as a parameter, and returns the same with each of its words reversed. The returned sentence should have 1 blank space between each pair of words.

Demonstrate the usage of this function from a main program.

Example:
Parameter: “jack and jill went up a hill”
Return Value: “kcaj dna llij tnew pu a llih”

Asked In Java jagrti porwal (9 years ago)
Unsolved Read Solution (10)
Is this Puzzle helpful?   (10)   (1) Submit Your Solution Arrays

(#M40154459) JAVA QUESTION no.of.uppercase lettere in paragraph Keep an EYE Keep an eye puzzle Keep an eye puzzle

import java.io.BufferedReader;
//import java.io.FileNotFoundException;
import java.io.FileReader;


public class Calculatefrompara {

private static BufferedReader bin;
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub


FileReader fin=new FileReader("test.txt");
bin = new BufferedReader(fin);

int Alphabets=0,digits=0,splchars=0,lowercase=0,uppercase=0;
String line=bin.readLine();

int i;
//char c1;
while(line!=null)
{
for( i=0;i=97 && j<=122)|| (j>=65 && j<=90))
{
Alphabets++;
}
else
if(j>=97 && j<=122)
{
lowercase++;
}

else
if(j>=65 && j<=90)
{
uppercase++;
}
else
if(j>=48 && j<=57)
{
digits++;
}
else
{
splchars++;
}


}
line=bin.readLine();


}

System.out.println("alphabets:"+Alphabets);
System.out.println("lowercase:"+lowercase);
System.out.println("uppercase:"+uppercase);
System.out.println("digits:"+digits);
System.out.println("splchrs:"+splchars);

}

}

Asked In Java ROHIT YADAV (9 years ago)
Unsolved Read Solution (2)
Is this Puzzle helpful?   (2)   (1) Submit Your Solution Program

(#M40154181) JAVA QUESTION Keep an EYE Keep an eye puzzle Keep an eye puzzle

You have a block of platinum that can be exchanged in your bank either for cash or for smaller blocks of platinum. If you exchange a block of m grams, you get three blocks of weight m/2, m/3 and m/4 grams each. You don't get any fractional part, as the division process rounds down the value. If you exchange the block of platinum for cash, you get m units of currency. You can do any number of exchanges for smaller blocks or currency.
Given the value of a block in grams as input, write a program that would print the largest possible currency value that you can receive as the output. Assume that the maximum value of a block that can be given as an input is 1,000,000,000 grams and the minimum value is 2 grams.

Asked In Java kumar anand (10 years ago)
Unsolved Read Solution (1)
Is this Puzzle helpful?   (11)   (10) Submit Your Solution Arrays

(#M40153974) JAVA QUESTION sudoku Keep an EYE Keep an eye puzzle Keep an eye puzzle

875432103654

Asked In Java Gaurav Sharma (10 years ago)
Unsolved Read Solution (2)
Is this Puzzle helpful?   (0)   (3) Submit Your Solution Database

(#M40153438) JAVA QUESTION program Keep an EYE Keep an eye puzzle Keep an eye puzzle

Question: Write a program to find all the combinations between 1 and 1000 in which
1. doubling the first number and substracting from the second number will give a result of zero.
2. if the result is not 0, double the result and use it as the first number and repeat step 1.

Asked In Java srikar (10 years ago)
Unsolved Read Solution (25)
Is this Puzzle helpful?   (22)   (2) Submit Your Solution Program

(#M40152330) JAVA QUESTION Jurgensville Restaurant Puzzle: Keep an EYE Keep an eye puzzle Keep an eye puzzle

Because it is the Internet Age, but also it is a recession, the Comptroller of the town of Jurgensville has decided to publish the prices of every item on every menu of every restaurant in town, all in a single CSV file (Jurgensville is not quite up to date with modern data serialization methods).

The file's format is:

for lines that define a price for a single item:
restaurant ID, price, item_label

All restaurant IDs are integers, all item labels are underscore(no space) separated letters, and the price is a decimal number.

Because you are an expert software engineer, you decide to write a program that accepts the town's price file, and a list of item labels that someone wants to eat for dinner, and outputs the restaurant they should go to, and the total price it will cost them.
Note: Total price should be minimum price among all restaurants in the town.

If multiple restaurants are found, output any restaurant ID with the minimum price.

Please solve the puzzle above using the development language that you are being interviewed for.
We have seen many solutions that work for the attached data-set.

Here are some sample data sets, program inputs, and the expected result:
----------------------------
Data File data.csv
1, 4.00, burger
1, 8.00, tofu_log
2, 5.00, burger
2, 6.50, tofu_log
Program Input:
program data.csv burger tofu_log
Expected Output:
2, 11.5

----------------------------
----------------------------
Data File data.csv
3, 4.00, chef_salad
3, 8.00, steak_salad_sandwich
4, 5.00, steak_salad_sandwich
4, 2.50, wine_spritzer
Program Input
program data.csv chef_salad wine_spritzer
Expected Output:
Nil (to indicate that no matching restaurant could be found)

----------------------------
----------------------------
Data File data.csv
5, 4.00, extreme_fajita
5, 8.00, fancy_european_water
6, 5.00, fancy_european_water
6, 6.00, extreme_fajita
Program Input:
program data.csv fancy_european_water extreme_fajita
Expected Output:
6, 11.0
----------------------------
We have included all these samples in the attached file, sample_data.csv.

Asked In Java lingam naveena (10 years ago)
Unsolved
Is this Puzzle helpful?   (0)   (0) Submit Your Solution
Keep an EYE (0)
Solved Question (3) UnSolved Question (258)
Pages: 27FirstPrev123456789NextLast
  • Login
  • Register

Resend

Sponsored Links

Advertisements

Challenger of the Day

no image
Dimple
India
Punjab
Time: 00:01:33
Points
19

Maths Quotes

please send me wipro question papers my ema in last 5 years and also tcs papers my email id is suresh85000@gmail.com

suresh

There is no Royal Road to Geometry

Euclid

Placed User Comments

M4Math helped me a lot.

Vipul Chavan 5 years ago

Thanks m4 maths for helping to get placed in several companies.
I must recommend this website for placement preparations.

yash mittal 5 years ago
  • 2533K+Registerd user
  • 1774K+Engineers
  • 759K+MBA Asprirant
  • 3K+Enginnering College
  • 250+Company Exam
  • 150K+Interview Questions
  • Site Links
  • Home
  • Result
  • Today's Puzzle
  • Discussion Board
  • Maths Tricks
  • Advertise with us
  • Contact Us
  • Useful Info
  • Maths Quotes
  • Previous Puzzles
  • Prize
  • Privacy Policy
  • Disclaimer and Copyright
  • Terms and Conditions
  • Sitemap
  • Placement papers
  • TCS Placement Paper
  • HCL Placement Paper
  • INFOSYS Placement Paper
  • IBM Placement Paper
  • SYNTEL Placement Paper
  • TECHNICAL Interview
  • HR Interview
All rights are reserved to @m4maths.com