K Ville

Ranch Hand
+ Follow
since Aug 16, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by K Ville

In addition, marking a variable/method "private" makes it implicitly final, too
K&B
Ravi, please don't hesitate in buying the book. It's worth it!!! Just allot an ample amount of time preparing and you'll make it. Promise!!! Not a born techie, I got an 85% in October of last year
What happens if you pass the VideoFormat constructor a null---as in new VideoFormat(null)? Does it contain nothing or does it specify that it supports all video formats?
21 years ago
What are common and different between these two? What do we use/create them for?
21 years ago
I'd like to know the differences among these:
Time base
Time base time
Time base
Media time
Media Start Time
21 years ago
I am trying to run Sun's TVApplet.java w/ JMF thru appletviewer. I am getting a NoClassDefFoundError: javax\media\ControllerListener. Is it in the codebase/archive param? I actually don't know what to put there.
21 years ago
Can some good souls please give me a link to where I could learn how to combine, run, and deploy my applet/app with JMF? Thanks. I need it very badly!
21 years ago
What does javaw do? How does it differ from java launcher?
21 years ago
I spotted a syntax error in my example. Pardon me for that. Supply the parameter in static getAddress:
String address = getAddress(userid);
Thanks!
21 years ago

1.public class Test{
2. public static void main(String[] args){
3. byte [][]big = new byte[7][7];
4. byte[][] b= new byte[2][1];
5. byte b3=5;
6. byte b2 [][][][]=new byte[2][3][1][2];
7. }// here!!
8.}
which of the answers could be insert in the line seven and still to permit of the code was compilated?(you have 4 correct answers)
a)b2[0][1] =b;//correct
b)b[0][0] =b3;//correct
c)b2[1][1][0] =b[0][0];//wrong ???
d)b2[1][2][0]=b;//wrong ???
e)b2[0][1][0][0]=b[0][0];//correct
f)b2[0][1]= big;//correct

Let's examine this one by one:
a)b2 is a 4-dimensional array(there are 4 brackets). With option a, it is trying to initialize b2[0][1] with b. In line number 4, you will see that b is a 2-dimensional array(there are 2 brackets). This means that b2[0][1] expects a 2-dimensional array to get completely initialized. If the initialization were changed to b2 = b, the code will not compile because it will state that b2 is a 4-dimensional array and expects a 4-dimensional array size. Hence, if it were changed to b2[0][1][2][0]=b3, then it would be a correcr initialization because all the dimensions were specified, it only needs a byte value to initialize the particular element. Same explanations for all the others.
If it's still a little vague to you, try to count the number of brackets(assuming the elements are not out of bounds). For example, int arr[] = new int[2]; int anotherarr[] = new int[3]; Then it is safe to initialize arr[] with arr = anotherarr regardless of size. Only the dimensions(brackets) are restricted.
I hope you understood my explanation. If you get this, you'll see that it's an easy topic. I got confused the first time I've read about this, too.
Does this version include jmf? Or must JMF be downloaded separately?
21 years ago
Can some tell me the significance of mentioning a parameter to a method as final.
For ex.
public String getAddress(final String userid) {
........
}

final arguments are important in such a way that whatever value it has when it was passed CANNOT be modified within the method that was invoked.
Example:
public static void someMethod{
String userid = "Mark Nelson";
String address = getAddress();
System.out.println("Name: " + userid);
System.out.println("Address: " + address);
//Mark Nelson, an avid customer, has now been changed to John Wayne!

}
public static String getAddress(final String userid){
userid = "John Wayne";//OOPS! Compiler error!
return "Austin, Texas";//How come Austin Texas is returned for a
//nonexisting user id?
}
21 years ago
Calling super() and this() at the same time within a constructor results in a compiler error
21 years ago
What is the difference between these two? What are the practical uses of each?
21 years ago
Got it solved already. Thanks, anyway!
21 years ago