Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the interview questions of big data?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what are the interview questions of big data". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. now please follow the editor's train of thought to study and learn "what are the interview questions of big data"?

1. Conversion between data types:

1) how to convert numeric characters to numbers?

2) how to convert numbers to characters?

3) how to take the first two decimal places and round them up? [basic]

A:

1) call the method parse*** (String) or valueOf (String) in the corresponding wrapper class of the numeric type to return the value of the corresponding base type or wrapper type

2) add the number and the empty string to get the corresponding string; in addition, for the basic type of number, you can also call valueOf (…) in the String class. Method returns the corresponding string, and for wrapper type numbers, you can call its toString () method to get the corresponding string

3) you can use this number to construct a java.math.BigDecimal object, then use its round () method to round it to two places after the reserved decimal point, and then convert it to a string to intercept the last two digits.

1. You need to insert an inner class declaration at line 3 which two inner class declarations are valid? (Choose two.)

Public class OuterClass {

Private double D1 = 1.0

/ / insert code here

}

A. Class InnerOne {

Public static double methoda () {return D1;}

}

B. Public class InnerOne {

Static double methoda () {return D1;}

}

C. Private class InnerOne {

Double methoda () {return D1;}

}

D. Static class InnerOne {

Protected double methoda () {return D1;}

}

E. Abstract class InnerOne {

Public abstract double methoda ()

}

Answer: the answer is C and E; the explanation is as follows:

1) static inner classes can have static members, while non-static inner classes cannot have static members, so An and B are wrong.

2) the non-static members of the static inner class can access the static variables of the external class, but not the non-static variables of the external class.

3) non-static members of non-static inner classes can access non-static variables of external classes; therefore, C is correct.

2. String operation: how to reverse and replace the string? [basic]

A: you can construct a StringBuffer object with a string, then call the reverse method in StringBuffer to reverse the string, and call the replace method to replace the string.

3. Transcoding: how to convert a string encoded by GB2312 into a string encoded by ISO-8859-1? [basic]

A: the sample code is as follows:

String S1 = "Hello"

String S2 = new String (s1.getBytes ("GB2312"), "ISO-8859-1")

4. Write a function that requires the input of a string and a character length to separate the string. [basic]

A: the function code is as follows:

Public String [] split (String str, int chars) {

Int n = (str.length () + chars-1) / chars

String ret [] = new String [n]

For (int iTuno; I 0); / / throws an Assertionerror if a

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report