text - question unresolved
text - question resolved
#text - Important
- Here Sleep will make which thread wait?
Thread.sleep(3000); ----makes the current operation wait for 3000 milli seconds
- Java Decomplier -- is external file that is used to get back the code from the byte code(.class file)
- It is better you perform only one main operation in a method, better create multiple methods for different operations
- How are class C and A put together in one line?
There are two classes Class A and Class C
A a = new C(); ---what does it mean
Sol: The above code is possible only if C extends A. Here 'a' is a object of class A that has access to properties of Class A and C.
- Java Build Path
- .classpath file
- How are we passing file path as parameter and also file is object. Whole syntax is not understandable ?
java.io.File file = new java.io.File("C:\\Users\\....");
- What will load method will have as parameter in the braces ?
Properties prop = new Properties();
prop.load(new FileInputStream(file));
- Why URI class has parameter and how the below code will work? Especially what value object will store based on value returned from URI construcutor?
URI uri = new URI(requestUri);
String resourceUri = uri.getPath().trim();
Sol: URI uri = new URI(requestUri); //Here when you run this code, URI method(basically a constructor) will get executed. Looks like whatever value that URI method will return, will be stored in object uri. Like what resourceUri variable will hold the data.
if so ####
#object could store other values too along with address
#Any in built method(specific to java) could be used with object, like here getPath() and trim() is used.
Why cant be this? because built in methods of java could not be used without object or class name.
String resource1= new URI(requestUri);
String resourceUri = resource1.getPath().trim();
- What does it say?
String port = (Integer.toString(uri.getPort()).trim().equals("-1")?Integer.toString(uri.toURL().getDefaultPort()).trim():Integer.toString(uri.getPort()).trim());
- Play with strings, is the below thing possible?
result = new String(Base64.encodeBase64(rawHmac)).replace("\r\n",
"");
#here result will have value from replace method. For Strings we do not have constructor to execute so replace method itself is used directly.
text - question resolved
#text - Important
- Here Sleep will make which thread wait?
Thread.sleep(3000); ----makes the current operation wait for 3000 milli seconds
- Java Decomplier -- is external file that is used to get back the code from the byte code(.class file)
- It is better you perform only one main operation in a method, better create multiple methods for different operations
- How are class C and A put together in one line?
There are two classes Class A and Class C
A a = new C(); ---what does it mean
Sol: The above code is possible only if C extends A. Here 'a' is a object of class A that has access to properties of Class A and C.
- Java Build Path
- .classpath file
- How are we passing file path as parameter and also file is object. Whole syntax is not understandable ?
java.io.File file = new java.io.File("C:\\Users\\....");
- What will load method will have as parameter in the braces ?
Properties prop = new Properties();
prop.load(new FileInputStream(file));
- Why URI class has parameter and how the below code will work? Especially what value object will store based on value returned from URI construcutor?
URI uri = new URI(requestUri);
String resourceUri = uri.getPath().trim();
Sol: URI uri = new URI(requestUri); //Here when you run this code, URI method(basically a constructor) will get executed. Looks like whatever value that URI method will return, will be stored in object uri. Like what resourceUri variable will hold the data.
if so ####
#object could store other values too along with address
#Any in built method(specific to java) could be used with object, like here getPath() and trim() is used.
Why cant be this? because built in methods of java could not be used without object or class name.
String resource1= new URI(requestUri);
String resourceUri = resource1.getPath().trim();
- What does it say?
String port = (Integer.toString(uri.getPort()).trim().equals("-1")?Integer.toString(uri.toURL().getDefaultPort()).trim():Integer.toString(uri.getPort()).trim());
- Play with strings, is the below thing possible?
result = new String(Base64.encodeBase64(rawHmac)).replace("\r\n",
"");
#here result will have value from replace method. For Strings we do not have constructor to execute so replace method itself is used directly.
No comments:
Post a Comment