karthikeya kumar

Greenhorn
+ Follow
since May 18, 2016
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by karthikeya kumar

Hi I am new to Java collections but I am very much interested to learn in depth on Java collections
and their implementation

Please suggest a good book which is understandable

thanks
6 years ago
As I was unable to reply in my interview I have reached this blog.
Some one please help me on that difference
6 years ago
Difference between Syntax and semantic
With clear example if someone asks me in an interview
6 years ago
What is the good book for learning Data structures in Java. Please suggest
I want clear information
6 years ago
I have one doubt on reverse of a string
My requirement is I want to write a method which returns reverse of the string I have sent.

I have tried with following code can someone please let me know where am I going wrong?

public class Reverse_string {


public static String rev(String s1)
{
String str[]=s1.split("");
char[] ch=s1.toCharArray();
for(int i=ch.length-1;i>=0;i--)
{

char c=ch[i];
Character s=Character.valueOf(c);

System.out.print(s.toString(c));
}
return
}
public static void main(String[] args) {
String r=rev("This is for test");
}

}

I am new to programming , please someone help how to return the reverse string whenever I call.
Please let me know if there is some mistake in my code.
6 years ago
Hi ,

I am new to java. I came across few doubts while I was searching answer for the following question
Why cant we use this and Super in static context?
Many answered that as this and super keyword are used for representing current as well as super class objects and as the static block is related to class but not object we cant access it

My Doubts:

1) But we will create object in static block itself right? we will create object in public static void main(String[] args) and access that instance variables.
When this is related to instance variable why cant I access the same from static block while I am creating the object itself in static blokc

2) Can we access instance variables from static blocks ? if so please give me an example.. I have searched for this question in internet and many answered that we cant directly access instance variables from static block but we can access by creating object of the class. If we can access by creating object of the class then why cant we use this keyword which refers to current class object from static block

Please reply to me. Eagerly waiting for you reply

With Regards,
Karthikeya
7 years ago
Difference between Late binding and Early Binding. Is there any difference between Dynamic polymor and Late binding. Can anyone give me an example
8 years ago

Henry Wong wrote:

karthikeya kumar wrote:In C language char has range from -127 to 128 but in Java char range is from 0 to 65535.Can I know why dont we have negative value range for char data type in Java



I would reverse the question. ASCII, extended ASCII, Unicode, etc. are all using non-negative values. So, what would the purpose of having negative values?

Henry



Hi Henry ,

I am new to Java. I cant answer to your question. Please expecting a positive reply from you instead of a question back to me. I wish you understand

thanks
8 years ago
In C language char has range from -127 to 128 but in Java char range is from 0 to 65535.Can I know why dont we have negative value range for char data type in Java
8 years ago
Can I know why is "goto" keyword considered under unused keyword
8 years ago

Bear Bibeault wrote:

karthikeya kumar wrote:I was explained by my sir that every o.s will have by default Java installed in that machine.


This. Is. Not. True.

Clear now?



Yes its clear.. Thanks for clearing my doubt
8 years ago

Tim Holloway wrote:Welcome to the JavaRanch, Karthikeya!

Java is a rather large software system and unlike COBOL and Fortran, it was developed as the property of a single corporation (Sun Microsystems). Sun was open to third-party implementations, so other vendors such as IBM produced their own products, such as J9.

However, the original Java implementation required some proprietary code, so the open-source OS's (such as Linux) couldn't include it and Microsoft got slapped for attempting to hijack Java into a proprietary system of their own, so Microsoft refused to bundle Java with Windows.

Sun worked on the proprietary issues as did a number of independent developers and the result was a series of JVMs ending up with the IcedTea JVM, which is a virtually complete implementation of the Java spec. This JVM is now routinely pre-installed as part of more popular Linux distros. Microsoft, however, still doesn't include Java with Windows.

One thing to note about the IcedTea JVM is that for a long time, it lacked certain features of the "official" JVMs, so it wasn't useful when you needed advanced JVM services, such as J2EE servers require. All of this is supposed to be fixed now, but most of us still prefer to use the Sun/Oracle JVM when doing industrial-grade Java work.




I was explained by my sir that every o.s will have by default Java installed in that machine. What my question is what does that default Java that is installed during O.S has?

For example if I download Java from internet and try to install in my machine JDK , JRE and JVM will be installed. what is the difference between the Java that we download and install , default Java provided in O.S
8 years ago

Henry Wong wrote:

karthikeya kumar wrote:
If O.S does not have Java installed or not then how come the byte code or the individual code gets executed.



If Java is not installed on the system, then the system can't run Java programs.

Henry



Hi Henry,

I was explained by my sir that every o.s will have by default Java installed in that machine. What my question is what does that default Java that is installed during O.S has?

For example if I download Java from internet and try to install in my machine JDK , JRE and JVM will be installed. what is the difference between the Java that we download and install , default Java provided in O.S
8 years ago
Thanks for your reply.

If O.S does not have Java installed or not then how come the byte code or the individual code gets executed.
8 years ago
Hi Guys,

I am new to core java.

My Doubt:

When we are going to load OS in the computer will we get Java by default? If so what options will be available for us

Today morning when my Sir was explaining about platform independent concept he told we can take the compiled code and execute on any O.S even though there is no Java as O.S will have some java settings for it.

Then what exactly does Java present in our O.S has I mean does it have JVM or JDK or JRE?

Depending on this answer I have one more doubt. Please clarify me at the earliest
8 years ago