Java
Programming and Technical
Programming
Definition
What is the default modifier for variables declared in interfaces.
Read Solution (Total 13)
-
- For all interface variables the access modifier is : "public static final"
For all interface methods to access modifier is "public abstract" - 9 years agoHelpfull: Yes(8) No(0)
- It is : public static final . You can check in command prompt by executing simple program by javap classname.java
- 9 years agoHelpfull: Yes(2) No(0)
- public abstract
- 9 years agoHelpfull: Yes(1) No(0)
- public static and final
- 9 years agoHelpfull: Yes(1) No(1)
- In interface,the default modifier is public
- 9 years agoHelpfull: Yes(0) No(0)
- public
why it is public means interface implicitly public static final variable - 9 years agoHelpfull: Yes(0) No(0)
- Public static final
- 9 years agoHelpfull: Yes(0) No(0)
- default modifier will be Public
- 9 years agoHelpfull: Yes(0) No(0)
- Public
B
Becoz it is by defalut public - 9 years agoHelpfull: Yes(0) No(0)
- public static final
- 9 years agoHelpfull: Yes(0) No(0)
- public ,static and final
- 7 years agoHelpfull: Yes(0) No(0)
- Public is default modifier for variables in interface
- 7 years agoHelpfull: Yes(0) No(0)
- public and abstract
- 7 years agoHelpfull: Yes(0) No(0)
Java Other Question
What are the types of methods in java
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.