Java.lang.class is a runtime representation of classes and interfaces.
Questions tagged [java.lang.class]
97 questions
2
votes
1 answer
Why do these two way to compare Class objects result differently?
I've defined two classes : Employee and Doctor, They're father and son. The code like this:
class Employee {
// ....
}
class Doctor extends Employee {
// ....
}
And then I wrote a main method like this:
public static void main(String[] args)…

HashMap
- 25
- 2
2
votes
0 answers
Xamarin.Android: TabLayout - Java.Lang.ClassCastException
In my App I am using a TabLayout. The Tabs for the Layout are added programmatically. In 99% of the cases it works fine, but every now and then I get a Java.Lang.ClassCastException while adding a tab. You cannot set a rule in which cases this…

Aiko West
- 791
- 1
- 10
- 30
2
votes
2 answers
java.lang.Class:ERROR while initializing log4j properties file in java program
I am trying to run a standalone java program using log4j, but receiving below while debugging (with no log4j related logs on console):
log= {Logger@1343} "java.lang.Class:ERROR in 18b4aac2"
Can someone please suggest what is wrong here?
The code is…

psg
- 121
- 2
- 6
2
votes
0 answers
What is the use of ClassValue in java?
I currently looking to master every classes in Java.lang but couldn't understand the use of ClassValue. I have seen the official documentation, it says,
public abstract class ClassValue
extends Object
Lazily associate a computed value with…

Yogeesh Hegde
- 31
- 1
- 3
2
votes
1 answer
java.lang.NumberFormatException: For input string: “ ”
So the issue I am getting seems to be a kind of common, however the missing points in each of the issues I checked online was different from the one I experiencing.
So what I am trying to do is converting a string back to long.
The string was read…

Abdelrahman Shoman
- 2,882
- 7
- 36
- 61
2
votes
4 answers
String index out of bounds? Where?
This is my code for finding the no. of vowels in a string:
{
String inyo=inpeo.getText().toLowerCase();
System.out.println(inyo); // Just checking for an empty string
int vowcount=0;
for(int i=0;i<=inyo.length();i++)
{
…

Mayukh Nair
- 623
- 1
- 6
- 26
2
votes
3 answers
'X.class' to get it's 'X' type?
I have written simple container that registers a class and it's interface and has a method to create object from that information like this:
public class DIContainer {
protected static DIContainer instance;
protected Hashtable,…

Andrius
- 19,658
- 37
- 143
- 243
2
votes
1 answer
java.lang.ClassCastException: android.app.Application - casting
java.lang.ClassCastException: android.app.Application cannot be cast to com.example.project.DataDevice
My code:
public class Project extends Activity{
private boolean connection = false;
public Tag tagFromIntent = null;
private Button…

Doszi89
- 357
- 2
- 5
- 20
1
vote
1 answer
Spring : java.lang.ClassNotFoundException: java/lang.Class
I'm creating beans with the following property
foo.bar.SomeClass
The property "classe" is of type Class.
just like someone hinted on the following question : Spring…

Drewman
- 947
- 11
- 23
1
vote
0 answers
groovy.lang.MissingMethodException: No signature of method with String
I'm new to Groovy and I run into this error that I don't really understand.
groovy.lang.MissingMethodException: No signature of method: getUsers() is applicable for argument types: (String, String, String, String, String, String) values: [ABC, DEF,…

jasper
- 11
- 1
1
vote
1 answer
java.lang.stackoverflowerror error in recursion
I've been trying to print the numeric pattern 4,5,9,18,34 through recursion but I'm getting java.lang.stackoverflowerror error. Here is my code for your reference.
Any help would be highly appreciated.
Thank You
public class pattern3 {
public…

Soumya
- 13
- 3
1
vote
1 answer
Can I store a value from a table search in a variable?
I have this code:
WebUI.openBrowser('')
WebUI.navigateToUrl('https://www.texaslending.com/')
WebUI.click(findTestObject('Page_TexasLending.com - When you think of m_ec7bcf/img_Simplify your search. Select your…

iollo
- 47
- 8
1
vote
0 answers
Why am I getting the java.lang.Boolean cannot be cast to clojure.lang.IFn error while validating fields in Clojure?
This is the validation function , vali is noir.validation:
(defn valid? [name description]
(vali/rule (vali/has-value? name)
[:name "Name is nil"])
(vali/rule (vali/has-value? description)
[:description…

Jovana Petkovic
- 31
- 3
1
vote
0 answers
XML-RPC How to convert C# string to java.lang.String
I'm trying to send data from Visual Studio 2017 C# Application to a rmeote service using XML-RPC as you can see in the following code:
[XmlRpcUrl("https://www.mensajerianegocios.movistar.es/SrvConexion")]
public interface ISendSMS : IXmlRpcProxy
{
…

Pimager
- 169
- 1
- 3
- 12
1
vote
1 answer
Kill process in Java
I run process from my Java code like this p = run.exec("cmd /c start \"\" C:\\");. At some point, I want to kill this process. Calling destroy() method on process kill the process, but I want to turn off command line, where procces…

M. Barabas
- 53
- 1
- 2
- 11